CVE-2024-57939: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: riscv: Fix sleeping in invalid context in die() die() can be called in exception handler, and therefore cannot sleep. However, die() takes spinlock_t which can sleep with PREEMPT_RT enabled. That causes the following warning: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 285, name: mutex preempt_count: 110001, expected: 0 RCU nest depth: 0, expected: 0 CPU: 0 UID: 0 PID: 285 Comm: mutex Not tainted 6.12.0-rc7-00022-ge19049cf7d56-dirty #234 Hardware name: riscv-virtio,qemu (DT) Call Trace: dump_backtrace+0x1c/0x24 show_stack+0x2c/0x38 dump_stack_lvl+0x5a/0x72 dump_stack+0x14/0x1c __might_resched+0x130/0x13a rt_spin_lock+0x2a/0x5c die+0x24/0x112 do_trap_insn_illegal+0xa0/0xea _new_vmalloc_restore_context_a0+0xcc/0xd8 Oops - illegal instruction [#1] Switch to use raw_spinlock_t, which does not sleep even with PREEMPT_RT enabled.
AI Analysis
Technical Summary
CVE-2024-57939 is a vulnerability identified in the Linux kernel specifically affecting the RISC-V architecture implementation. The issue arises from the improper use of spinlock mechanisms within the die() function, which is invoked during exception handling. The die() function takes a spinlock_t type lock, which can sleep when the PREEMPT_RT (Real-Time Preemption) patch is enabled. Sleeping in this context is invalid because exception handlers must not sleep, leading to kernel warnings and potential instability. The warning message indicates that a sleeping function was called from an invalid context, with in_atomic() and irqs_disabled() flags set, which violates kernel locking rules. This can cause kernel oops or crashes due to illegal instructions or improper scheduling behavior. The root cause is that spinlock_t can sleep under PREEMPT_RT, but die() must not sleep. The fix involves switching from spinlock_t to raw_spinlock_t, which does not sleep even with PREEMPT_RT enabled, thereby preserving the atomic and non-sleeping context required in exception handlers. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix and is relevant for systems running the Linux kernel on RISC-V hardware or emulators like QEMU. No known exploits are reported in the wild as of now, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, the impact of this vulnerability depends largely on the deployment of Linux systems running on RISC-V architecture with PREEMPT_RT enabled. While RISC-V is an emerging architecture, its adoption in embedded systems, IoT devices, and specialized computing platforms is growing. Organizations using such systems in critical infrastructure, industrial control, or real-time applications could face system instability, unexpected kernel crashes, or denial of service conditions if the vulnerability is triggered. This could lead to downtime, loss of availability, and potential disruption of services. Although the vulnerability does not directly expose confidentiality or integrity risks, the resulting kernel instability could be exploited as a denial-of-service vector or could complicate incident response and recovery. The lack of known exploits reduces immediate risk, but the vulnerability's presence in kernel exception handling makes it a reliability concern for real-time and safety-critical applications prevalent in sectors such as manufacturing, automotive, and telecommunications within Europe.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions where this vulnerability is patched, specifically ensuring that the kernel uses raw_spinlock_t in the die() function for RISC-V architectures with PREEMPT_RT enabled. For systems where immediate patching is not feasible, organizations should audit their use of PREEMPT_RT on RISC-V platforms and consider disabling PREEMPT_RT temporarily if the risk of kernel crashes outweighs real-time performance needs. Additionally, organizations should implement robust monitoring for kernel oops, warnings, and crashes to detect any manifestation of this issue early. Testing kernel updates in staging environments that replicate production RISC-V workloads is recommended to validate stability. Vendors and integrators deploying RISC-V Linux systems should communicate this fix to customers and ensure firmware and kernel updates are distributed promptly. Finally, organizations should maintain an inventory of devices running RISC-V Linux kernels to assess exposure and prioritize remediation efforts accordingly.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland
CVE-2024-57939: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: riscv: Fix sleeping in invalid context in die() die() can be called in exception handler, and therefore cannot sleep. However, die() takes spinlock_t which can sleep with PREEMPT_RT enabled. That causes the following warning: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 285, name: mutex preempt_count: 110001, expected: 0 RCU nest depth: 0, expected: 0 CPU: 0 UID: 0 PID: 285 Comm: mutex Not tainted 6.12.0-rc7-00022-ge19049cf7d56-dirty #234 Hardware name: riscv-virtio,qemu (DT) Call Trace: dump_backtrace+0x1c/0x24 show_stack+0x2c/0x38 dump_stack_lvl+0x5a/0x72 dump_stack+0x14/0x1c __might_resched+0x130/0x13a rt_spin_lock+0x2a/0x5c die+0x24/0x112 do_trap_insn_illegal+0xa0/0xea _new_vmalloc_restore_context_a0+0xcc/0xd8 Oops - illegal instruction [#1] Switch to use raw_spinlock_t, which does not sleep even with PREEMPT_RT enabled.
AI-Powered Analysis
Technical Analysis
CVE-2024-57939 is a vulnerability identified in the Linux kernel specifically affecting the RISC-V architecture implementation. The issue arises from the improper use of spinlock mechanisms within the die() function, which is invoked during exception handling. The die() function takes a spinlock_t type lock, which can sleep when the PREEMPT_RT (Real-Time Preemption) patch is enabled. Sleeping in this context is invalid because exception handlers must not sleep, leading to kernel warnings and potential instability. The warning message indicates that a sleeping function was called from an invalid context, with in_atomic() and irqs_disabled() flags set, which violates kernel locking rules. This can cause kernel oops or crashes due to illegal instructions or improper scheduling behavior. The root cause is that spinlock_t can sleep under PREEMPT_RT, but die() must not sleep. The fix involves switching from spinlock_t to raw_spinlock_t, which does not sleep even with PREEMPT_RT enabled, thereby preserving the atomic and non-sleeping context required in exception handlers. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix and is relevant for systems running the Linux kernel on RISC-V hardware or emulators like QEMU. No known exploits are reported in the wild as of now, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, the impact of this vulnerability depends largely on the deployment of Linux systems running on RISC-V architecture with PREEMPT_RT enabled. While RISC-V is an emerging architecture, its adoption in embedded systems, IoT devices, and specialized computing platforms is growing. Organizations using such systems in critical infrastructure, industrial control, or real-time applications could face system instability, unexpected kernel crashes, or denial of service conditions if the vulnerability is triggered. This could lead to downtime, loss of availability, and potential disruption of services. Although the vulnerability does not directly expose confidentiality or integrity risks, the resulting kernel instability could be exploited as a denial-of-service vector or could complicate incident response and recovery. The lack of known exploits reduces immediate risk, but the vulnerability's presence in kernel exception handling makes it a reliability concern for real-time and safety-critical applications prevalent in sectors such as manufacturing, automotive, and telecommunications within Europe.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions where this vulnerability is patched, specifically ensuring that the kernel uses raw_spinlock_t in the die() function for RISC-V architectures with PREEMPT_RT enabled. For systems where immediate patching is not feasible, organizations should audit their use of PREEMPT_RT on RISC-V platforms and consider disabling PREEMPT_RT temporarily if the risk of kernel crashes outweighs real-time performance needs. Additionally, organizations should implement robust monitoring for kernel oops, warnings, and crashes to detect any manifestation of this issue early. Testing kernel updates in staging environments that replicate production RISC-V workloads is recommended to validate stability. Vendors and integrators deploying RISC-V Linux systems should communicate this fix to customers and ensure firmware and kernel updates are distributed promptly. Finally, organizations should maintain an inventory of devices running RISC-V Linux kernels to assess exposure and prioritize remediation efforts accordingly.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2025-01-19T11:50:08.378Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9823c4522896dcbdeb0b
Added to database: 5/21/2025, 9:08:51 AM
Last enriched: 6/28/2025, 9:11:33 AM
Last updated: 8/16/2025, 8:06:55 PM
Views: 11
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.