CVE-2024-39495·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: greybus: Fix use-after-free bug in gb_interface_release due to race condition. In gb_interface_create, &intf->mode_switch_completion is bound with gb_interface_mode_switch_work. Then it will be started by gb_interface_request_mode_switch. Here is the relevant code. if (!queue_work(system_long_wq, &intf->mode_switch_work)) { ... } If we call gb_interface_release to make cleanup, there may be an unfinished work. This function will call kfree to free the object "intf". However, if gb_interface_mode_switch_work is scheduled to run after kfree, it may cause use-after-free error as gb_interface_mode_switch_work will use the object "intf". The possible execution flow that may lead to the issue is as follows: CPU0 CPU1 | gb_interface_create | gb_interface_request_mode_switch gb_interface_release | kfree(intf) (free) | | gb_interface_mode_switch_work | mutex_lock(&intf->mutex) (use) Fix it by canceling the work before kfree.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.6
- Published
- 2024-07-12
Affected versions
From: 6.7
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 patch a critical use-after-free vulnerability in the Greybus interface subsystem. This flaw occurs when a mode switch work is scheduled but the interface object is freed before the work completes, potentially allowing local privilege escalation. Apply the patch immediately on systems running kernel versions 6.7 through 6.9.5.
sudo dnf upgrade kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Run `uname -r` to check your current kernel version; if it is between 6.7 and 6.9.5, you are vulnerable.
- Check if Greybus modules are loaded: `lsmod | grep -i greybus`; if output appears, the vulnerable subsystem is active.
- Search kernel logs for Greybus-related crashes: `sudo dmesg | grep -i greybus` or `sudo journalctl -u kernel | grep -i greybus` to identify past exploitation attempts.
- After patching, verify the fix: `uname -r` should show 6.9.6 or later, and `sudo dmesg | tail -20` should confirm successful boot without use-after-free errors.
FAQ
What is CVE-2024-39495?
CVE-2024-39495 is a use-after-free vulnerability in the Linux kernel's Greybus interface driver caused by a race condition between work queue scheduling and memory deallocation. If a mode switch operation is pending when the interface is released, the kernel may attempt to access freed memory, leading to privilege escalation or denial of service.
Is CVE-2024-39495 being actively exploited?
No, CVE-2024-39495 is not currently listed on CISA's Known Exploited Vulnerabilities catalog, and no public exploits are available. However, the vulnerability is easily reproducible by local attackers with basic kernel knowledge.
What versions of Kernel are affected by CVE-2024-39495?
Linux kernel versions 6.7 through 6.9.5 are affected. The vulnerability was patched in kernel 6.9.6 and later stable releases.
How do I check if my server is vulnerable to CVE-2024-39495?
Execute `uname -r` to display your kernel version; compare it against the affected range (6.7–6.9.5). If your version falls within this range, your system is vulnerable and requires immediate patching.
Does Defensia detect CVE-2024-39495?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-39495 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/03ea2b129344152157418929f06726989efc0445
- https://git.kernel.org/stable/c/0b8fba38bdfb848fac52e71270b2aa3538c996ea
- https://git.kernel.org/stable/c/2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83
- https://git.kernel.org/stable/c/5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce
- https://git.kernel.org/stable/c/74cd0a421896b2e07eafe7da4275302bfecef201
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-39495. Free for 1 server.
Get started free