Vulnerability · Published Sep 4, 2024 · Assigned by Linux

CVE-2024-45003vfs: Don't evict inode under the inode lru traversing context

Medium 4.7

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 7% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)4.7Medium
Exploit odds (30 days)0.2%top 93.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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---

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.112-1DEBIAN-CVE-2024-45003
Debian:12linux6.1.112-1DSA-5782-1
Debian:13linux6.10.7-1DEBIAN-CVE-2024-45003
Debian:14linux6.10.7-1DEBIAN-CVE-2024-45003
Ubuntu:22.04:LTSlinux5.15.0-125.135UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux6.8.0-50.51UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-aws5.15.0-1072.78UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-aws6.8.0-1020.22UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1020.22~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure5.15.0-1075.84UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-azure6.8.0-1020.23UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1020.23~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1076.85.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gcp5.15.0-1071.79UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-gcp6.8.0-1019.21UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1019.21~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gke5.15.0-1069.75UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-gke6.8.0-1015.19UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1055.62UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1002.4UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-50.51~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-ibm5.15.0-1065.68UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-ibm6.8.0-1017.17UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1017.17~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1067.73UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-kvm5.15.0-1069.74UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-125.135UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-50.51.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-50.51.1~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1067.68UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1019.21UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1019.21~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1019.21.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1032.32UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1020.20UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1018.18UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oracle5.15.0-1070.76UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-oracle6.8.0-1017.18UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1017.18~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-raspi5.15.0-1065.68UBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-raspi6.8.0-1016.18UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-riscv6.8.0-50.51.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-50.51.1~22.04.1UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-45003
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2024-45003
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1038.42UBUNTU-CVE-2024-45003

Affected products (as reported)

VendorProductVersions
Linux Linux e50e5129f384ae282adebfb561189cdb19b81cee – before 3525ad25240dfdd8c78f3470911ed10aa727aa72e50e5129f384ae282adebfb561189cdb19b81cee – before 03880af02a78bc9a98b5a581f529cf709c88a9b8e50e5129f384ae282adebfb561189cdb19b81cee – before cda54ec82c0f9d05393242b20b13f69b083f7e88e50e5129f384ae282adebfb561189cdb19b81cee – before 437741eba63bf4e437e2beb5583f8633556a2b98e50e5129f384ae282adebfb561189cdb19b81cee – before b9bda5f6012dd00372f3a06a82ed8971a4c57c32e50e5129f384ae282adebfb561189cdb19b81cee – before 9063ab49c11e9518a3f2352434bb276cc8134c5fe50e5129f384ae282adebfb561189cdb19b81cee – before 2a0629834cd82f05d424bbc193374f9a43d1f87d
Linux Linux 4.13

References