CVE-2024-38667·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: riscv: prevent pt_regs corruption for secondary idle threads Top of the kernel thread stack should be reserved for pt_regs. However this is not the case for the idle threads of the secondary boot harts. Their stacks overlap with their pt_regs, so both may get corrupted. Similar issue has been fixed for the primary hart, see c7cdd96eca28 ("riscv: prevent stack corruption by reserving task_pt_regs(p) early"). However that fix was not propagated to the secondary harts. The problem has been noticed in some CPU hotplug tests with V enabled. The function smp_callin stored several registers on stack, corrupting top of pt_regs structure including status field. As a result, kernel attempted to save or restore inexistent V context.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.9.4
- Published
- 2024-06-24
Affected versions
From: 6.7
Until: 6.9.4
Fixed in: 6.9.4
How to fix this CVE
Update your Linux kernel to version 6.9.4 or later to resolve a critical pt_regs corruption issue affecting secondary CPU cores on RISC-V systems. This vulnerability can lead to kernel memory corruption and system instability, particularly during CPU hotplug operations. Immediate kernel patching and system reboot are required to apply the fix.
sudo dnf update kernel kernel-devel && sudo rebootDefensia 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 to 6.9.3)
- Step 2: Verify RISC-V architecture support and secondary CPU presence with `cat /proc/cpuinfo | grep -i riscv` and `nproc --all`
- Step 3: Search kernel logs for pt_regs corruption or V extension context errors using `journalctl -k | grep -i 'pt_regs\|vector\|V extension'`
- Step 4: Confirm the patch is applied by checking if kernel version is 6.9.4 or later with `uname -r` and verifying stack alignment with `cat /proc/sys/kernel/kptr_restrict`
FAQ
What is CVE-2024-38667?
CVE-2024-38667 is a memory corruption vulnerability in the Linux kernel's RISC-V architecture where the kernel stack of secondary CPU cores overlaps with the pt_regs (processor state) structure, allowing register data to be corrupted when secondary CPUs are initialized or during CPU hotplug operations.
Is CVE-2024-38667 being actively exploited?
No. This vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog and no public exploits are currently available. However, its high CVSS score (7.8) indicates serious potential impact and should still be prioritized for patching.
What versions of Kernel are affected by CVE-2024-38667?
Linux kernel versions 6.7 through 6.9.3 are affected. The vulnerability was patched in kernel 6.9.4 and subsequent releases. RISC-V systems are the primary target, particularly those with multiple CPU cores or V (Vector) extension support.
How do I check if my server is vulnerable to CVE-2024-38667?
Run `uname -r` to check your kernel version. If it reports a version between 6.7 and 6.9.3, you are vulnerable. You can additionally check for RISC-V architecture with `uname -m` and CPU count with `nproc --all`.
Does Defensia detect CVE-2024-38667?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2024-38667 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0c1f28c32a194303da630fca89481334b9547b80
- https://git.kernel.org/stable/c/3090c06d50eaa91317f84bf3eac4c265e6cb8d44
- https://git.kernel.org/stable/c/a638b0461b58aa3205cd9d5f14d6f703d795b4af
- https://git.kernel.org/stable/c/ea22d4195cca13d5fdbc4d6555a2dfb8a7867a9e
- https://git.kernel.org/stable/c/0c1f28c32a194303da630fca89481334b9547b80
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-38667. Free for 1 server.
Get started free