nday
CVE-2024-45003

vfs: Don't evict inode under the inode lru traversing context

Linux / Linux

披露于 。本站尚未获取修复依据,不能据此认为没有补丁。四个 PoC 来源都还没有收录。尚未列入 CISA KEV。

标签 漏洞类型race condition 攻击途径本地无需用户交互 产品Linux kernel 产品类型操作系统
这些标签的依据

这些标签由 nday 按固定规则从下列事实自动推导,不是 NVD、编号分配方或其他来源给出的。全部标签和规则见 ~/tags。

race condition
CWE-667(来源:NVD 分析人员)
本地
NVD 分析人员 给出的 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H(CVSS 3.1)中的 AV:L
无需用户交互
NVD 分析人员 给出的 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H(CVSS 3.1)中的 UI:N
Linux kernel
CVE 记录列出的受影响产品:Linux · LinuxNVD 分析人员标为易受攻击的 CPE 名称:o:linux:linux_kernel
操作系统
CVE 记录列出的受影响产品:Linux · LinuxNVD 分析人员标为易受攻击的 CPE 名称:o:linux:linux_kernelnday 产品登记表中 Linux kernel 的产品类型
当前阶段
DIS
披露
CVSS
暂无评分

生命周期

横轴 UTC;点=精确到分钟,宽条=仅日期,空心=未知或推定。
时间未知
DIS披露
2024-09-04T19:54Z
PAT补丁
尚无记录
ANA分析
尚无记录
POCPoC
尚无记录
ITW在野
尚无记录
KEVKEV
尚无记录

摘要

In the Linux kernel, the following vulnerability has been resolved:

vfs: Don't evict inode under the inode lru traversing context

The inode reclaiming process(See function prune_icache_sb) collects all reclaimable inodes and mark them with I_FREEING flag at first, at that time, other processes will be stuck if they try getting these inodes (See function find_inode_fast), then the reclaiming process destroy the inodes by function dispose_list(). Some filesystems(eg. ext4 with ea_inode feature, ubifs with xattr) may do inode lookup in the inode evicting callback function, if the inode lookup is operated under the inode lru traversing context, deadlock problems may happen.

Case 1: In function ext4_evict_inode(), the ea inode lookup could happen if ea_inode feature is enabled, the lookup process will be stuck under the evicting context like this:

1. File A has inode i_reg and an ea inode i_ea 2. getfattr(A, xattr_buf) // i_ea is added into lru // lru->i_ea 3. Then, following three processes running like this:

   PA                              PB
echo 2 > /proc/sys/vm/drop_caches
 shrink_slab
  prune_dcache_sb
  // i_reg is added into lru, lru->i_ea->i_reg
  prune_icache_sb
   list_lru_walk_one
    inode_lru_isolate
     i_ea->i_state |= I_FREEING // set inode state
    inode_lru_isolate
     __iget(i_reg)
     spin_unlock(&i_reg->i_lock)
     spin_unlock(lru_lock)
                                    rm file A
                                     i_reg->nlink = 0
     iput(i_reg) // i_reg->nlink is 0, do evict
      ext4_evict_inode
       ext4_xattr_delete_inode
        ext4_xattr_inode_dec_ref_all
         ext4_xattr_inode_iget
          ext4_iget(i_ea->i_ino)
           iget_locked
            find_inode_fast
             __wait_on_freeing_inode(i_ea) ----→ AA deadlock
   dispose_list // cannot be executed by prune_icache_sb
    wake_up_bit(&i_ea->i_state)

Case 2: In deleted inode writing function ubifs_jnl_write_inode(), file deleting process holds BASEHD's wbuf->io_mutex while getting the xattr inode, which could race with inode reclaiming process(The reclaiming process could try locking BASEHD's wbuf->io_mutex in inode evicting function), then an ABBA deadlock problem would happen as following:

1. File A has inode ia and a xattr(with inode ixa), regular file B has inode ib and a xattr. 2. getfattr(A, xattr_buf) // ixa is added into lru // lru->ixa 3. Then, following three processes running like this:

PA                PB                        PC
        echo 2 > /proc/sys/vm/drop_caches
         shrink_slab
          prune_dcache_sb

// ib and ia are added into lru, lru->ixa->ib->ia

                 prune_icache_sb
                  list_lru_walk_one
                   inode_lru_isolate
                    ixa->i_state |= I_FREEING // set inode state
                   inode_lru_isolate
                    __iget(ib)
                    spin_unlock(&ib->i_lock)
                    spin_unlock(lru_lock)
                                                  rm file B
                                                   ib->nlink = 0
rm file A
 iput(ia)
  ubifs_evict_inode(ia)
   ubifs_jnl_delete_inode(ia)
    ubifs_jnl_write_inode(ia)
     make_reservation(BASEHD) // Lock wbuf->io_mutex
     ubifs_iget(ixa->i_ino)
      iget_locked
       find_inode_fast
        __wait_on_freeing_inode(ixa)
         |          iput(ib) // ib->nlink is 0, do evict
         |           ubifs_evict_inode
         |            ubifs_jnl_delete_inode(ib)
         ↓             ubifs_jnl_write_inode
    ABBA deadlock ←-----make_reservation(BASEHD)
                  dispose_list // cannot be executed by prune_icache_sb
                   wake_up_bit(&ixa->i_state)

Fix the possible deadlock by using new inode state flag I_LRU_ISOLATING to pin the inode in memory while inode_lru_isolate( ---truncated---

以上是 CVE 记录(cvelist)中的原文,未经改写。

事件记录

+DIS披露

CVE 记录发布,编号分配方是 Linux。

来源 cvelist · 本站 批量导入 · 原始记录
{
  "id": 340423,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2024-45003",
  "occurred_at": "2024-09-04T19:54:46.276Z",
  "observed_at": "2026-11-13T05:38:38.958665Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "ssvc": {
      "timestamp": "2024-09-04T20:18:27.700271Z",
      "automatable": "no",
      "exploitation": "none",
      "technical_impact": "partial"
    },
    "state": "PUBLISHED",
    "date_published": "2024-09-04T19:54:46.276Z",
    "assigner_short_name": "Linux"
  }
}

纠错

报告错误或缺失

页面有误或缺失?告诉编辑;采纳后在本页修订记录公开说明,上游数据不会被改动。

研究员讨论

近 7 天有 0 位研究员提到

研究员在 X 上提到此 CVE 的帖子,原文照录,nday 不核实。

尚未采集到名单内研究员在 X 上提到此 CVE 的帖子。

讨论

0 条评论

还没有评论。