<?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>8149</bug_id>
          <alias>CVE-2024-24855</alias>
          <creation_ts>2024-02-01 17:16:12 +0000</creation_ts>
          <short_desc>scsi: lpfc的lpfc_unregister_fcf_rescan函数存在竞争条件</short_desc>
          <delta_ts>2024-03-06 09:59:03 +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>NEW</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>25633</commentid>
    <comment_count>0</comment_count>
    <who name="Shiloong">shile.zhang</who>
    <bug_when>2024-02-01 17:16:12 +0000</bug_when>
    <thetext>上报人信息：
  - 白家驹 &lt;baijiaju@buaa.edu.cn&gt;
  - 北京航空航天大学网络空间安全学院

成因：
phba-&gt;fcf.fcf_flag的写操作需要spinlock phba-&gt;hbalock保护，lpfc_unregister_fcf_rescan函数中phba-&gt;fcf.fcf_flag = 0语句没有被对应的spinlock保护，可以发生关于phba-&gt;fcf.fcf_flag的数据竞争。

	
危害：
bug触发后，phba-&gt;fcf.fcf_flag的置0操作可能被覆盖，phba-&gt;fcf.fcf_flag用于记录HBA FCF状态，是lpfc模块的核心变量，决定了驱动函数行为，置0操作被覆盖会导致如lpfc_linkdown、lpfc_work_done等函数发生错误，导致lpfc功能异常，可以用于拒绝服务，甚至触发双重释放等严重的内存问题。


缓解：
   -  把lpfc_unregister_fcf_rescan函数中的phba-&gt;fcf.fcf_flag |= FCF_INIT_DISC语句两侧添加相应的spin_lock，防止数据竞争。

修复：
补丁已提交给Linux Kernel并被接收，补丁链接：https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0e881c0a4b6146b7e856735226208f48251facd8</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>