<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.openanolis.cn/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.openanolis.cn/"
          
          maintainer="service@openanolis.org"
>

    <bug>
          <bug_id>8150</bug_id>
          <alias>CVE-2024-24861</alias>
          <creation_ts>2024-02-01 17:19:10 +0000</creation_ts>
          <short_desc>[media] xc4000的xc4000_get_frequency函数存在竞争条件</short_desc>
          <delta_ts>2024-03-21 09:54:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>ANCK</classification>
          <product>ANCK 5.10 Dev</product>
          <component>drivers</component>
          <version>5.10.y-16</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>IN_PROGRESS</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3-Medium</priority>
          <bug_severity>S3-normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Shiloong">shile.zhang</reporter>
          <assigned_to name="GuixinLiu">kanie</assigned_to>
          <cc>mqaio</cc>
    
    
    <cc>xlpang</cc>
          
          <qa_contact name="shuming">qingming.su</qa_contact>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>25634</commentid>
    <comment_count>0</comment_count>
    <who name="Shiloong">shile.zhang</who>
    <bug_when>2024-02-01 17:19:10 +0000</bug_when>
    <thetext>上报人信息：
  - 白家驹 &lt;baijiaju@buaa.edu.cn&gt;
  - 北京航空航天大学网络空间安全学院

成因：
在xc4000_get_frequency中，通过*freq = priv-&gt;freq_hz + priv-&gt;freq_offset读取frequency，没有持有任何锁，但在读取过程中，priv-&gt;freq_hz和priv-&gt;freq_offset可能被xc4000_set_params并发地进行更新，从而使xc4000_get_frequency读取到了中间值，priv-&gt;freq_hz和priv-&gt;freq_offset不匹配，返回错误数值甚至整数溢出。

	
危害：
xc4000_get_frequency是xc4000驱动接口dvb_tuner_ops的get_frequency项函数，选择xc4000作为tuner的media设备均会受到此漏洞的影响，读取到错误的frequency值，影响相关ioctl；在em28xx等依赖于读取的frequency设置新frequency的设备中，还会导致设置非法frequency，造成设备异常。

选择xc4000作为tuner的media相关ioctl返回错误值溢出值；根据实现的不同，会导致部分设备异常，可以用于拒绝服务攻击。

修复缓解：
   -  在xc4000_get_frequency函数中，读取priv-&gt;freq_hz和priv-&gt;freq_offset时，持有priv-&gt;lock mutex锁，阻止xc4000_set_params并发执行进行更新。

补丁已提交给Linux Kernel Media子系统维护者，补丁链接：https://patchwork.kernel.org/project/linux-media/patch/20231222055030.5237-1-2045gemini@gmail.com/  
https://lore.kernel.org/lkml/20231222055030.5237-1-2045gemini@gmail.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26787</commentid>
    <comment_count>1</comment_count>
    <who name="Shiloong">shile.zhang</who>
    <bug_when>2024-03-21 09:54:44 +0000</bug_when>
    <thetext>patch has been queued in linux-next:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20240320&amp;id=36d503ad547d1c75758a6fcdbec2806f1b6aeb41</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>