CVE-2024-26840: cachefiles: fix memory leak in cachefiles_add_cache()

Published Apr 17, 2024
·
Updated

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

cachefiles: fix memory leak in cachefilesaddcache()

The following memory leak was reported after unbinding /dev/cachefiles:

================================================================== unreferenced object 0xffff9b674176e3c0 (size 192): comm "cachefilesd2", pid 680, jiffies 4294881224 hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc ea38a44b): [] kmemcachealloc+0x2d5/0x370 [] preparecreds+0x26/0x2e0 [] cachefilesdeterminecachesecurity+0x1f/0x120 [] cachefilesaddcache+0x13c/0x3a0 [] cachefilesdaemonwrite+0x146/0x1c0 [] vfswrite+0xcb/0x520 [] ksyswrite+0x69/0xf0 [] dosyscall64+0x72/0x140 [] entrySYSCALL64afterhwframe+0x6e/0x76 ==================================================================

Put the reference count of cachecred in cachefilesdaemonunbind() to fix the problem. And also put cachecred in cachefilesaddcache() error branch to avoid memory leaks.

Other sources

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

cachefiles: fix memory leak in cachefilesaddcache()

The following memory leak was reported after unbinding /dev/cachefiles:

================================================================== unreferenced object 0xffff9b674176e3c0 (size 192): comm "cachefilesd2", pid 680, jiffies 4294881224 hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc ea38a44b): [<ffffffff8eb8a1a5>] kmemcachealloc+0x2d5/0x370 [<ffffffff8e917f86>] preparecreds+0x26/0x2e0 [<ffffffffc002eeef>] cachefilesdeterminecachesecurity+0x1f/0x120 [<ffffffffc00243ec>] cachefilesaddcache+0x13c/0x3a0 [<ffffffffc0025216>] cachefilesdaemonwrite+0x146/0x1c0 [<ffffffff8ebc4a3b>] vfswrite+0xcb/0x520 [<ffffffff8ebc5069>] ksyswrite+0x69/0xf0 [<ffffffff8f6d4662>] dosyscall64+0x72/0x140 [<ffffffff8f8000aa>] entrySYSCALL64afterhwframe+0x6e/0x76 ==================================================================

Put the reference count of cachecred in cachefilesdaemonunbind() to fix the problem. And also put cachecred in cachefilesaddcache() error branch to avoid memory leaks.

NVD

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

cachefiles: fix memory leak in cachefilesaddcache()

The Linux kernel CVE team has assigned CVE-2024-26840 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024041715-CVE-2024-26840-057d@gregkh/T

Red Hat

Affected Software

25 affected componentsFixes available
Linux Linux kernel>=2.6.30<4.19.309
Linux Linux kernel>=4.20<5.4.271
Linux Linux kernel>=5.5<5.10.212
Linux Linux kernel>=5.11<5.15.151
Linux Linux kernel>=5.16<6.1.80
Linux Linux kernel>=6.2<6.6.19
Linux Linux kernel>=6.7<6.7.7
Linux Linux kernel=6.8-rc1
Linux Linux kernel=6.8-rc2
Linux Linux kernel=6.8-rc3
Linux Linux kernel=6.8-rc4
Linux Linux kernel=6.8-rc5
IBM Security Verify Governance<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Software Stack<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Virtual Appliance<=ISVG 10.0.2
IBM Security Verify Governance Identity Manager Container<=ISVG 10.0.2
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
redhat/kernel<4.19.309
4.19.309
redhat/kernel<5.4.271
5.4.271
redhat/kernel<5.10.212
5.10.212
redhat/kernel<5.15.151
5.15.151
redhat/kernel<6.1.80
6.1.80
redhat/kernel<6.6.19
6.6.19
redhat/kernel<6.7.7
6.7.7
redhat/kernel<6.8
6.8

Event History

Apr 17, 2024
CVE Published
via MITRE·10:10 AM
Data Sourced
via MITRE·10:10 AM
Description
Data Sourced
via Red Hat·04:03 PM
DescriptionSeverityAffected Software
Jun 8, 2024
Data Sourced
via Launchpad·01:07 AM
Description
Apr 28, 2025
Data Sourced
via Ubuntu·02:20 PM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

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

CVE-2024-26840 has been categorized as a moderate severity vulnerability due to a memory leak in the Linux kernel cachefiles component.

2

How do I fix CVE-2024-26840?

To mitigate CVE-2024-26840, upgrade to the fixed versions of the kernel, specifically 4.19.309, 5.4.271, 5.10.212, 5.15.151, 6.1.80, 6.6.19, 6.7.7, or 6.8.

3

What systems are affected by CVE-2024-26840?

CVE-2024-26840 affects multiple versions of the Linux kernel across various distributions, particularly Red Hat and Debian systems.

4

What type of vulnerability is CVE-2024-26840?

CVE-2024-26840 is classified as a memory leak vulnerability in the cachefiles component of the Linux kernel.

5

Is there a workaround for CVE-2024-26840?

While the most effective solution is to upgrade to a patched kernel version, temporary workarounds may involve minimizing the use of cachefiles until a fix is applied.

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