CVE-2024-39496·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: btrfs: zoned: fix use-after-free due to race with dev replace While loading a zone's info during creation of a block group, we can race with a device replace operation and then trigger a use-after-free on the device that was just replaced (source device of the replace operation). This happens because at btrfs_load_zone_info() we extract a device from the chunk map into a local variable and then use the device while not under the protection of the device replace rwsem. So if there's a device replace operation happening when we extract the device and that device is the source of the replace operation, we will trigger a use-after-free if before we finish using the device the replace operation finishes and frees the device. Fix this by enlarging the critical section under the protection of the device replace rwsem so that all uses of the device are done inside the critical section.
- 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 3% 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-39496 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.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 resolve this use-after-free vulnerability in the Btrfs zoned storage subsystem. The vulnerability occurs when device replacement operations race with zone information loading, potentially causing kernel memory corruption. Apply the kernel update and reboot your system to activate the patched version.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your running kernel version with: uname -r — if the version is between 6.7 and 6.9.5 (inclusive), your system is potentially vulnerable.
- Verify Btrfs is in use: mount | grep btrfs — if Btrfs filesystems are mounted, this CVE is relevant to your system.
- Check kernel configuration for Btrfs zoned support: grep CONFIG_BLK_DEV_ZONED /boot/config-$(uname -r) — if set to 'y', the vulnerable code path may be active.
- After applying the kernel update, reboot and verify the new version: uname -r — confirm the kernel version is 6.9.6 or higher.
FAQ
What is CVE-2024-39496?
CVE-2024-39496 is a use-after-free vulnerability in the Linux kernel's Btrfs zoned storage implementation. It occurs when a device replacement operation races with zone information loading, potentially freeing device memory while it is still being accessed, leading to kernel memory corruption or crash.
Is CVE-2024-39496 being actively exploited?
No, CVE-2024-39496 is not listed on the CISA KEV catalog and has no publicly available exploits. However, the high CVSS score (7.8) and local privilege requirement indicate this should still be prioritized for patching.
What versions of Kernel are affected by CVE-2024-39496?
Linux kernel versions 6.7 through 6.9.5 are affected. The vulnerability was resolved in kernel version 6.9.6 and later.
How do I check if my server is vulnerable to CVE-2024-39496?
Run 'uname -r' to check your kernel version — if it falls between 6.7 and 6.9.5, and you use Btrfs with zoned storage devices, your system is vulnerable. Run 'mount | grep btrfs' to confirm Btrfs is in use.
Does Defensia detect CVE-2024-39496?
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-39496 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0090d6e1b210551e63cf43958dc7a1ec942cdde9
- https://git.kernel.org/stable/c/092571ef9a812566c8f2c9038d9c2a64c49788d6
- https://git.kernel.org/stable/c/17765964703b88d8befd899f8501150bb7e07e43
- https://git.kernel.org/stable/c/a0cc006f4214b87e70983c692e05bb36c59b5752
- https://git.kernel.org/stable/c/0090d6e1b210551e63cf43958dc7a1ec942cdde9
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-39496. Free for 1 server.
Get started free