CVE-2024-39510·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: cachefiles: fix slab-use-after-free in cachefiles_ondemand_daemon_read() We got the following issue in a fuzz test of randomly issuing the restore command: ================================================================== BUG: KASAN: slab-use-after-free in cachefiles_ondemand_daemon_read+0xb41/0xb60 Read of size 8 at addr ffff888122e84088 by task ondemand-04-dae/963 CPU: 13 PID: 963 Comm: ondemand-04-dae Not tainted 6.8.0-dirty #564 Call Trace: kasan_report+0x93/0xc0 cachefiles_ondemand_daemon_read+0xb41/0xb60 vfs_read+0x169/0xb50 ksys_read+0xf5/0x1e0 Allocated by task 116: kmem_cache_alloc+0x140/0x3a0 cachefiles_lookup_cookie+0x140/0xcd0 fscache_cookie_state_machine+0x43c/0x1230 [...] Freed by task 792: kmem_cache_free+0xfe/0x390 cachefiles_put_object+0x241/0x480 fscache_cookie_state_machine+0x5c8/0x1230 [...] ================================================================== Following is the process that triggers the issue: mount | daemon_thread1 | daemon_thread2 ------------------------------------------------------------ cachefiles_withdraw_cookie cachefiles_ondemand_clean_object(object) cachefiles_ondemand_send_req REQ_A = kzalloc(sizeof(*req) + data_len) wait_for_completion(&REQ_A->done) cachefiles_daemon_read cachefiles_ondemand_daemon_read REQ_A = cachefiles_ondemand_select_req msg->object_id = req->object->ondemand->ondemand_id ------ restore ------ cachefiles_ondemand_restore xas_for_each(&xas, req, ULONG_MAX) xas_set_mark(&xas, CACHEFILES_REQ_NEW) cachefiles_daemon_read cachefiles_ondemand_daemon_read REQ_A = cachefiles_ondemand_select_req copy_to_user(_buffer, msg, n) xa_erase(&cache->reqs, id) complete(&REQ_A->done) ------ close(fd) ------ cachefiles_ondemand_fd_release cachefiles_put_object cachefiles_put_object kmem_cache_free(cachefiles_object_jar, object) REQ_A->object->ondemand->ondemand_id // object UAF !!! When we see the request within xa_lock, req->object must not have been freed yet, so grab the reference count of object before xa_unlock to avoid the above issue.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.6
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 2% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2024-39510 scores 7.8 on CVSS, so a successful attack would be serious — but at <0.1%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 6.8
Until: 6.9.6
Fixed in: 6.9.6
How to fix this CVE
Update your Linux kernel to version 6.9.6 or later to resolve a use-after-free vulnerability in the cachefiles ondemand daemon. This flaw can allow local attackers with user-level privileges to cause kernel memory corruption through concurrent daemon read operations. Immediate patching is strongly recommended for systems running affected kernel versions 6.8 through 6.9.5.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check the installed kernel version with `uname -r` and compare against the affected range (6.8.0 to 6.9.5)
- Step 2: Verify if cachefiles is in use by checking `grep -i cachefiles /proc/modules` — if present, the vulnerable code path is loaded
- Step 3: Monitor kernel logs for KASAN (KernelAddressSanitizer) reports with the pattern 'slab-use-after-free' or 'cachefiles_ondemand_daemon_read' using `sudo journalctl -xe | grep -i 'use-after-free\|cachefiles'`
- Step 4: After patching, verify the kernel version with `uname -r` to confirm version is 6.9.6 or later
FAQ
What is CVE-2024-39510?
CVE-2024-39510 is a use-after-free vulnerability in the Linux kernel's cachefiles ondemand daemon that occurs when multiple threads concurrently process requests, allowing one thread to access memory already freed by another, potentially leading to kernel corruption or privilege escalation.
Is CVE-2024-39510 being actively exploited?
No, CVE-2024-39510 is not listed on the CISA Known Exploited Vulnerabilities catalog and has no publicly available exploit code at this time.
What versions of Kernel are affected by CVE-2024-39510?
Linux kernel versions 6.8.0 through 6.9.5 are vulnerable; version 6.9.6 and later include the fix.
How do I check if my server is vulnerable to CVE-2024-39510?
Run `uname -r` to check your kernel version — if it falls between 6.8.0 and 6.9.5, your system is vulnerable. Additionally, confirm cachefiles is loaded with `grep cachefiles /proc/modules`.
Does Defensia detect CVE-2024-39510?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel package is installed on a monitored server running versions 6.8 through 6.9.5, CVE-2024-39510 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/3958679c49152391209b32be3357193300a51abd
- https://git.kernel.org/stable/c/93064676a2820420a2d37d7c8289f277fe20793d
- https://git.kernel.org/stable/c/cb55625f8eb9d2de8be4da0c4580d48cbb32058e
- https://git.kernel.org/stable/c/da4a827416066191aafeeccee50a8836a826ba10
- https://git.kernel.org/stable/c/3958679c49152391209b32be3357193300a51abd
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-39510. Free for 1 server.
Get started free