CWE
401
Advisory Published
CVE Published
Updated

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

First published: Wed Apr 17 2024(Updated: )

In the Linux kernel, the following vulnerability has been resolved: cachefiles: fix memory leak in cachefiles_add_cache() 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>] kmem_cache_alloc+0x2d5/0x370 [<ffffffff8e917f86>] prepare_creds+0x26/0x2e0 [<ffffffffc002eeef>] cachefiles_determine_cache_security+0x1f/0x120 [<ffffffffc00243ec>] cachefiles_add_cache+0x13c/0x3a0 [<ffffffffc0025216>] cachefiles_daemon_write+0x146/0x1c0 [<ffffffff8ebc4a3b>] vfs_write+0xcb/0x520 [<ffffffff8ebc5069>] ksys_write+0x69/0xf0 [<ffffffff8f6d4662>] do_syscall_64+0x72/0x140 [<ffffffff8f8000aa>] entry_SYSCALL_64_after_hwframe+0x6e/0x76 ================================================================== Put the reference count of cache_cred in cachefiles_daemon_unbind() to fix the problem. And also put cache_cred in cachefiles_add_cache() error branch to avoid memory leaks.

Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Affected SoftwareAffected VersionHow to fix
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
Linux Kernel>=2.6.30<4.19.309
Linux Kernel>=4.20<5.4.271
Linux Kernel>=5.5<5.10.212
Linux Kernel>=5.11<5.15.151
Linux Kernel>=5.16<6.1.80
Linux Kernel>=6.2<6.6.19
Linux Kernel>=6.7<6.7.7
Linux Kernel=6.8-rc1
Linux Kernel=6.8-rc2
Linux Kernel=6.8-rc3
Linux Kernel=6.8-rc4
Linux Kernel=6.8-rc5
debian/linux
5.10.223-1
5.10.226-1
6.1.123-1
6.1.119-1
6.12.10-1
6.12.11-1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

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

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

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

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

  • 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.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203