CVE-2024-35955·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: kprobes: Fix possible use-after-free issue on kprobe registration When unloading a module, its state is changing MODULE_STATE_LIVE -> MODULE_STATE_GOING -> MODULE_STATE_UNFORMED. Each change will take a time. `is_module_text_address()` and `__module_text_address()` works with MODULE_STATE_LIVE and MODULE_STATE_GOING. If we use `is_module_text_address()` and `__module_text_address()` separately, there is a chance that the first one is succeeded but the next one is failed because module->state becomes MODULE_STATE_UNFORMED between those operations. In `check_kprobe_address_safe()`, if the second `__module_text_address()` is failed, that is ignored because it expected a kernel_text address. But it may have failed simply because module->state has been changed to MODULE_STATE_UNFORMED. In this case, arm_kprobe() will try to modify non-exist module text address (use-after-free). To fix this problem, we should not use separated `is_module_text_address()` and `__module_text_address()`, but use only `__module_text_address()` once and do `try_module_get(module)` which is only available with MODULE_STATE_LIVE.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.8.7
- Published
- 2024-05-20
Affected versions
From: 6.7
Until: 6.8.7
Fixed in: 6.8.7
How to fix this CVE
Update your Linux kernel to version 6.8.7 or later to resolve a use-after-free vulnerability in the kprobes subsystem that could allow privilege escalation during module unloading. This fix consolidates module state checking to prevent race conditions where kprobe registration attempts to modify memory from modules that are being unloaded.
sudo dnf check-update && sudo dnf install kernel kernel-devel --refreshDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check your current kernel version with `uname -r` and compare against the affected range 6.7.x to 6.8.6
- Step 2: Verify kprobes subsystem is loaded by checking `cat /proc/modules | grep kprobes` or `lsmod | grep kprobe`
- Step 3: Search system logs for kprobe-related errors or memory faults: `sudo journalctl -u kernel --grep='kprobe\|use.*after.*free' -n 100`
- Step 4: After applying updates, run `uname -r` again and confirm the version is 6.8.7 or later, then reboot and verify with `uname -r` post-reboot
FAQ
What is CVE-2024-35955?
This vulnerability is a use-after-free race condition in the Linux kernel's kprobes dynamic instrumentation mechanism. During module unloading, the kprobe registration function can attempt to instrument memory addresses belonging to a module that has already been freed, potentially leading to kernel code execution with elevated privileges.
Is CVE-2024-35955 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available. However, the high CVSS score (8.8) indicates significant security impact if exploited.
What versions of Kernel are affected by CVE-2024-35955?
Linux kernel versions 6.7.0 through 6.8.6 are vulnerable. The fix was integrated in kernel 6.8.7 and all subsequent versions.
How do I check if my server is vulnerable to CVE-2024-35955?
Run `uname -r` to display your kernel version. If the output shows a version between 6.7 and 6.8.6 (inclusive), your system is vulnerable. Cross-reference the exact version against your distro's kernel package release notes.
Does Defensia detect CVE-2024-35955?
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-35955 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/2df2dd27066cdba8041e46a64362325626bdfb2e
- https://git.kernel.org/stable/c/325f3fb551f8cd672dbbfc4cf58b14f9ee3fc9e8
- https://git.kernel.org/stable/c/36b57c7d2f8b7de224980f1a284432846ad71ca0
- https://git.kernel.org/stable/c/5062d1f4f07facbdade0f402d9a04a788f52e26d
- https://git.kernel.org/stable/c/62029bc9ff2c17a4e3a2478d83418ec575413808
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-35955. Free for 1 server.
Get started free