CVE-2024-49870: cachefiles: fix dentry leak in cachefiles_open_file()

Published Oct 21, 2024
·
Updated

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

cachefiles: fix dentry leak in cachefilesopenfile()

A dentry leak may be caused when a lookup cookie and a cull are concurrent:

P1 | P2 ----------------------------------------------------------- cachefileslookupcookie cachefileslookupobject lookuponepositiveunlocked // get dentry cachefilescull inode->iflags |= SKERNELFILE; cachefilesopenfile cachefilesmarkinodeinuse cachefilesmarkinodeinuse canuse = false if (!(inode->iflags & SKERNELFILE)) canuse = true return false return false // Returns an error but doesn't put dentry

After that the following WARNING will be triggered when the backend folder is umounted:

================================================================== BUG: Dentry 000000008ad87947{i=7a,n=Dx11.img} still in use (1) [unmount of ext4 sda] WARNING: CPU: 4 PID: 359261 at fs/dcache.c:1767 umountcheck+0x5d/0x70 CPU: 4 PID: 359261 Comm: umount Not tainted 6.6.0-dirty #25 RIP: 0010:umountcheck+0x5d/0x70 Call Trace: <TASK> dwalk+0xda/0x2b0 doonetree+0x20/0x40 shrinkdcacheforumount+0x2c/0x90 genericshutdownsuper+0x20/0x160 killblocksuper+0x1a/0x40 ext4killsb+0x22/0x40 deactivatelockedsuper+0x35/0x80 cleanupmnt+0x104/0x160 ==================================================================

Whether cachefilesopenfile() returns true or false, the reference count obtained by lookuppositiveunlocked() in cachefileslookupobject() should be released.

Therefore release that reference count in cachefileslookupobject() to fix the above issue and simplify the code.

Other sources

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

cachefiles: fix dentry leak in cachefilesopenfile()

A dentry leak may be caused when a lookup cookie and a cull are concurrent:

P1 | P2 ----------------------------------------------------------- cachefileslookupcookie cachefileslookupobject lookuponepositiveunlocked // get dentry cachefilescull inode->iflags |= SKERNELFILE; cachefilesopenfile cachefilesmarkinodeinuse cachefilesmarkinodeinuse canuse = false if (!(inode->iflags & SKERNELFILE)) canuse = true return false return false // Returns an error but doesn't put dentry

After that the following WARNING will be triggered when the backend folder is umounted:

================================================================== BUG: Dentry 000000008ad87947{i=7a,n=Dx11.img} still in use (1) [unmount of ext4 sda] WARNING: CPU: 4 PID: 359261 at fs/dcache.c:1767 umountcheck+0x5d/0x70 CPU: 4 PID: 359261 Comm: umount Not tainted 6.6.0-dirty #25 RIP: 0010:umountcheck+0x5d/0x70 Call Trace: <TASK> dwalk+0xda/0x2b0 doonetree+0x20/0x40 shrinkdcacheforumount+0x2c/0x90 genericshutdownsuper+0x20/0x160 killblocksuper+0x1a/0x40 ext4killsb+0x22/0x40 deactivatelockedsuper+0x35/0x80 cleanupmnt+0x104/0x160 ==================================================================

Whether cachefilesopenfile() returns true or false, the reference count obtained by lookuppositiveunlocked() in cachefileslookupobject() should be released.

Therefore release that reference count in cachefileslookupobject() to fix the above issue and simplify the code.

NVD

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

7 affected componentsFixes available
Linux Linux kernel>=5.17<6.1.113
Linux Linux kernel>=6.2<6.6.55
Linux Linux kernel>=6.7<6.10.14
Linux Linux kernel>=6.11<6.11.3
Linux Linux kernel=6.12-rc1
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1

Event History

Oct 21, 2024
CVE Published
via MITRE·06:01 PM
Data Sourced
via MITRE·06:01 PM
Description
Data Sourced
via NVD·06:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·07:04 PM
DescriptionSeverityAffected Software
Feb 20, 2025
Data Sourced
via Launchpad·12:45 AM
Description
May 3, 2025
Data Sourced
via Ubuntu·12:55 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-49870?

The severity of CVE-2024-49870 has not been explicitly stated but generally falls under the category of kernel vulnerabilities which can lead to serious system performance issues.

2

How do I fix CVE-2024-49870?

To fix CVE-2024-49870, update your Linux kernel to the latest patched version that addresses this vulnerability.

3

What versions of the Linux kernel are affected by CVE-2024-49870?

CVE-2024-49870 affects several versions of the Linux kernel from 5.17 to the pre-release versions of 6.12-rc1.

4

What are the potential impacts of CVE-2024-49870?

The potential impacts of CVE-2024-49870 include performance degradation due to the dentry leak in concurrent operations.

5

Is there a workaround for CVE-2024-49870?

There are no recommended workarounds for CVE-2024-49870 other than applying the available kernel updates.

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