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

Published Sep 4, 2024
·
Updated

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 pruneicachesb) collects all reclaimable inodes and mark them with IFREEING flag at first, at that time, other processes will be stuck if they try getting these inodes (See function findinodefast), then the reclaiming process destroy the inodes by function disposelist(). Some filesystems(eg. ext4 with eainode 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 ext4evictinode(), the ea inode lookup could happen if eainode feature is enabled, the lookup process will be stuck under the evicting context like this:

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

PA PB echo 2 > /proc/sys/vm/dropcaches shrinkslab prunedcachesb // ireg is added into lru, lru->iea->ireg pruneicachesb listlruwalkone inodelruisolate iea->istate |= IFREEING // set inode state inodelruisolate iget(ireg) spinunlock(&ireg->ilock) spinunlock(lrulock) rm file A ireg->nlink = 0 iput(ireg) // ireg->nlink is 0, do evict ext4evictinode ext4xattrdeleteinode ext4xattrinodedecrefall ext4xattrinodeiget ext4iget(iea->iino) igetlocked findinodefast waitonfreeinginode(iea) ----→ AA deadlock disposelist // cannot be executed by pruneicachesb wakeupbit(&iea->istate)

Case 2: In deleted inode writing function ubifsjnlwriteinode(), file deleting process holds BASEHD's wbuf->iomutex while getting the xattr inode, which could race with inode reclaiming process(The reclaiming process could try locking BASEHD's wbuf->iomutex 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, xattrbuf) // ixa is added into lru // lru->ixa 3. Then, following three processes running like this:

PA PB PC echo 2 > /proc/sys/vm/dropcaches shrinkslab prunedcachesb // ib and ia are added into lru, lru->ixa->ib->ia pruneicachesb listlruwalkone inodelruisolate ixa->istate |= IFREEING // set inode state inodelruisolate iget(ib) spinunlock(&ib->ilock) spinunlock(lrulock) rm file B ib->nlink = 0 rm file A iput(ia) ubifsevictinode(ia) ubifsjnldeleteinode(ia) ubifsjnlwriteinode(ia) makereservation(BASEHD) // Lock wbuf->iomutex ubifsiget(ixa->iino) igetlocked findinodefast waitonfreeinginode(ixa) | iput(ib) // ib->nlink is 0, do evict | ubifsevictinode | ubifsjnldeleteinode(ib) ↓ ubifsjnlwriteinode ABBA deadlock ←-----makereservation(BASEHD) disposelist // cannot be executed by pruneicachesb wakeupbit(&ixa->istate)

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

Affected Software

16 affected componentsFixes available
Linux Linux kernel>=4.13<5.4.283
Linux Linux kernel>=5.5<5.10.225
Linux Linux kernel>=5.11<5.15.166
Linux Linux kernel>=5.16<6.1.107
Linux Linux kernel>=6.2<6.6.48
Linux Linux kernel>=6.7<6.10.7
Linux Linux kernel=6.11-rc1
Linux Linux kernel=6.11-rc2
Linux Linux kernel=6.11-rc3
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1
Microsoft cbl2 kernel 5.15.164.1-1
Microsoft azl3 kernel 6.6.47.1-1
Microsoft cbl2 kernel 5.15.164.1-1
Microsoft azl3 kernel 6.6.51.1-5
Microsoft cbl2 kernel 5.15.167.1-1

Event History

Sep 4, 2024
CVE Published
via MITRE·07:54 PM
Data Sourced
via MITRE·07:54 PM
Description
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Oct 14, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
May 1, 2025
Data Sourced
via Ubuntu·12:36 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-45003?

CVE-2024-45003 is rated as a medium severity vulnerability.

2

How do I fix CVE-2024-45003?

To fix CVE-2024-45003, upgrade your Linux kernel to the patched version 5.10.226-1, 6.1.123-1, or another recommended version listed in the advisory.

3

What versions of Linux are affected by CVE-2024-45003?

CVE-2024-45003 affects various versions of the Linux kernel ranging from 4.13 up to several prior to 6.11-rc3.

4

Is CVE-2024-45003 being actively exploited?

As of the latest information, there are no reports indicating that CVE-2024-45003 is actively being exploited in the wild.

5

What systems should prioritize patching for CVE-2024-45003?

Systems running affected versions of the Linux kernel, particularly in production or critical environments, should prioritize patching for CVE-2024-45003.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203