CVE-2024-50275·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: arm64/sve: Discard stale CPU state when handling SVE traps The logic for handling SVE traps manipulates saved FPSIMD/SVE state incorrectly, and a race with preemption can result in a task having TIF_SVE set and TIF_FOREIGN_FPSTATE clear even though the live CPU state is stale (e.g. with SVE traps enabled). This has been observed to result in warnings from do_sve_acc() where SVE traps are not expected while TIF_SVE is set: | if (test_and_set_thread_flag(TIF_SVE)) | WARN_ON(1); /* SVE access shouldn't have trapped */ Warnings of this form have been reported intermittently, e.g. https://lore.kernel.org/linux-arm-kernel/CA+G9fYtEGe_DhY2Ms7+L7NKsLYUomGsgqpdBj+QwDLeSg=JhGg@mail.gmail.com/ https://lore.kernel.org/linux-arm-kernel/000000000000511e9a060ce5a45c@google.com/ The race can occur when the SVE trap handler is preempted before and after manipulating the saved FPSIMD/SVE state, starting and ending on the same CPU, e.g. | void do_sve_acc(unsigned long esr, struct pt_regs *regs) | { | // Trap on CPU 0 with TIF_SVE clear, SVE traps enabled | // task->fpsimd_cpu is 0. | // per_cpu_ptr(&fpsimd_last_state, 0) is task. | | ... | | // Preempted; migrated from CPU 0 to CPU 1. | // TIF_FOREIGN_FPSTATE is set. | | get_cpu_fpsimd_context(); | | if (test_and_set_thread_flag(TIF_SVE)) | WARN_ON(1); /* SVE access shouldn't have trapped */ | | sve_init_regs() { | if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) { | ... | } else { | fpsimd_to_sve(current); | current->thread.fp_type = FP_STATE_SVE; | } | } | | put_cpu_fpsimd_context(); | | // Preempted; migrated from CPU 1 to CPU 0. | // task->fpsimd_cpu is still 0 | // If per_cpu_ptr(&fpsimd_last_state, 0) is still task then: | // - Stale HW state is reused (with SVE traps enabled) | // - TIF_FOREIGN_FPSTATE is cleared | // - A return to userspace skips HW state restore | } Fix the case where the state is not live and TIF_FOREIGN_FPSTATE is set by calling fpsimd_flush_task_state() to detach from the saved CPU state. This ensures that a subsequent context switch will not reuse the stale CPU state, and will instead set TIF_FOREIGN_FPSTATE, forcing the new state to be reloaded from memory prior to a return to userspace.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.11.8
- Published
- 2024-11-19
Affected versions
From: 6.7
Until: 6.11.8
Fixed in: 6.11.8
How to fix this CVE
Update your Linux kernel to version 6.11.8 or later to resolve a race condition in ARM64 SVE (Scalable Vector Extension) trap handling that can cause CPU state inconsistencies. This fix ensures proper state management during preemption and context switching, preventing kernel warnings and potential system instability. Apply the kernel update through your distribution's package manager and reboot your system to activate the patched version.
sudo dnf update kernel kernel-devel kernel-headers && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Run 'uname -r' to check your current kernel version and verify it is below 6.11.8
- Check dmesg logs for 'SVE access shouldn't have trapped' warnings using: grep -i 'sve access' /var/log/kern.log or dmesg
- Look for repeated kernel warnings related to TIF_SVE and TIF_FOREIGN_FPSTATE inconsistencies in system logs: journalctl -k | grep -i 'warn'
- After patching, run 'uname -r' again to confirm the kernel version is 6.11.8 or later, then verify no new SVE-related warnings appear over 24 hours of operation
FAQ
What is CVE-2024-50275?
CVE-2024-50275 is a race condition in the Linux kernel's ARM64 SVE trap handler that allows CPU floating-point state to become stale when a task is preempted between state updates, leading to kernel warnings and potential system instability.
Is CVE-2024-50275 being actively exploited?
No, CVE-2024-50275 is not listed on the CISA KEV catalog and has no known public exploits. However, it can trigger kernel warnings and requires patching to prevent system reliability issues.
What versions of Kernel are affected by CVE-2024-50275?
Linux kernel versions 6.7 through 6.11.7 are affected. The vulnerability is fixed in kernel 6.11.8 and later.
How do I check if my server is vulnerable to CVE-2024-50275?
Run 'uname -r' to check your kernel version. If it reports a version between 6.7 and 6.11.7 (inclusive) on ARM64 systems, your server is vulnerable.
Does Defensia detect CVE-2024-50275?
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-50275 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/51d11ea0250d6ee461987403bbfd4b2abb5613a7
- https://git.kernel.org/stable/c/51d3d80a6dc314982a9a0aeb0961085922a1aa15
- https://git.kernel.org/stable/c/751ecf6afd6568adc98f2a6052315552c0483d18
- https://git.kernel.org/stable/c/de529504b3274d57caf8f66800b714b0d3ee235a
- https://git.kernel.org/stable/c/fa9ce027b3ce37a2bb173bf2553b5caa438fd8c9
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-50275. Free for 1 server.
Get started free