Skip to main content

CVE-2024-40980: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-40980cvecve-2024-40980
Published: Fri Jul 12 2024 (07/12/2024, 12:32:15 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: drop_monitor: replace spin_lock by raw_spin_lock trace_drop_common() is called with preemption disabled, and it acquires a spin_lock. This is problematic for RT kernels because spin_locks are sleeping locks in this configuration, which causes the following splat: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 449, name: rcuc/47 preempt_count: 1, expected: 0 RCU nest depth: 2, expected: 2 5 locks held by rcuc/47/449: #0: ff1100086ec30a60 ((softirq_ctrl.lock)){+.+.}-{2:2}, at: __local_bh_disable_ip+0x105/0x210 #1: ffffffffb394a280 (rcu_read_lock){....}-{1:2}, at: rt_spin_lock+0xbf/0x130 #2: ffffffffb394a280 (rcu_read_lock){....}-{1:2}, at: __local_bh_disable_ip+0x11c/0x210 #3: ffffffffb394a160 (rcu_callback){....}-{0:0}, at: rcu_do_batch+0x360/0xc70 #4: ff1100086ee07520 (&data->lock){+.+.}-{2:2}, at: trace_drop_common.constprop.0+0xb5/0x290 irq event stamp: 139909 hardirqs last enabled at (139908): [<ffffffffb1df2b33>] _raw_spin_unlock_irqrestore+0x63/0x80 hardirqs last disabled at (139909): [<ffffffffb19bd03d>] trace_drop_common.constprop.0+0x26d/0x290 softirqs last enabled at (139892): [<ffffffffb07a1083>] __local_bh_enable_ip+0x103/0x170 softirqs last disabled at (139898): [<ffffffffb0909b33>] rcu_cpu_kthread+0x93/0x1f0 Preemption disabled at: [<ffffffffb1de786b>] rt_mutex_slowunlock+0xab/0x2e0 CPU: 47 PID: 449 Comm: rcuc/47 Not tainted 6.9.0-rc2-rt1+ #7 Hardware name: Dell Inc. PowerEdge R650/0Y2G81, BIOS 1.6.5 04/15/2022 Call Trace: <TASK> dump_stack_lvl+0x8c/0xd0 dump_stack+0x14/0x20 __might_resched+0x21e/0x2f0 rt_spin_lock+0x5e/0x130 ? trace_drop_common.constprop.0+0xb5/0x290 ? skb_queue_purge_reason.part.0+0x1bf/0x230 trace_drop_common.constprop.0+0xb5/0x290 ? preempt_count_sub+0x1c/0xd0 ? _raw_spin_unlock_irqrestore+0x4a/0x80 ? __pfx_trace_drop_common.constprop.0+0x10/0x10 ? rt_mutex_slowunlock+0x26a/0x2e0 ? skb_queue_purge_reason.part.0+0x1bf/0x230 ? __pfx_rt_mutex_slowunlock+0x10/0x10 ? skb_queue_purge_reason.part.0+0x1bf/0x230 trace_kfree_skb_hit+0x15/0x20 trace_kfree_skb+0xe9/0x150 kfree_skb_reason+0x7b/0x110 skb_queue_purge_reason.part.0+0x1bf/0x230 ? __pfx_skb_queue_purge_reason.part.0+0x10/0x10 ? mark_lock.part.0+0x8a/0x520 ... trace_drop_common() also disables interrupts, but this is a minor issue because we could easily replace it with a local_lock. Replace the spin_lock with raw_spin_lock to avoid sleeping in atomic context.

AI-Powered Analysis

AILast updated: 07/04/2025, 04:57:25 UTC

Technical Analysis

CVE-2024-40980 is a vulnerability identified in the Linux kernel related to improper locking mechanisms within the drop_monitor subsystem. Specifically, the function trace_drop_common() is called with preemption disabled and acquires a spin_lock. In real-time (RT) Linux kernels, spin_locks are implemented as sleeping locks, which are not safe to use in atomic contexts where sleeping is forbidden. This misuse leads to a kernel BUG triggered by calling a sleeping function from an invalid context, causing kernel panics or system crashes. The detailed kernel stack trace shows that the issue arises due to the use of spin_lock instead of raw_spin_lock in an atomic context where preemption is disabled and interrupts are managed. The vulnerability affects Linux kernel versions identified by the commit hash 4ea7e38696c7e798c47ebbecadfd392f23f814f9 and likely related versions around this commit. The fix involves replacing spin_lock with raw_spin_lock to prevent sleeping in atomic contexts, ensuring that the locking mechanism does not cause kernel faults. This vulnerability is particularly relevant for systems running real-time Linux kernels, which are used in environments requiring deterministic response times. The vulnerability does not have a known exploit in the wild and lacks a CVSS score, but it poses a risk of denial of service through kernel crashes. The issue is technical and low-level, affecting kernel stability and reliability rather than direct confidentiality or integrity breaches.

Potential Impact

For European organizations, the primary impact of CVE-2024-40980 is on system availability and reliability, especially for those deploying real-time Linux kernels in critical infrastructure, industrial control systems, telecommunications, and embedded systems. Kernel panics or crashes caused by this vulnerability can lead to service interruptions, potentially affecting operational continuity. Organizations relying on Linux-based real-time systems for manufacturing automation, energy grid management, or telecommunications may experience downtime or degraded performance. Although this vulnerability does not directly expose data confidentiality or integrity, the resulting denial of service can have cascading effects on business operations and safety-critical processes. The impact is more pronounced in sectors where real-time Linux kernels are prevalent and where system stability is paramount. Since the vulnerability requires kernel-level code execution context, exploitation is less likely through remote attacks but could be triggered by local processes or kernel modules mishandling the affected code paths. Therefore, the threat is significant for organizations with specialized Linux deployments but less so for general-purpose Linux server environments.

Mitigation Recommendations

Mitigation requires updating the Linux kernel to a version where the patch replacing spin_lock with raw_spin_lock in the drop_monitor subsystem is applied. Organizations should: 1) Identify all systems running real-time Linux kernels, particularly those using kernel versions around the affected commit. 2) Prioritize patching these systems with the latest stable kernel releases that include the fix for CVE-2024-40980. 3) For systems where immediate patching is not feasible, consider disabling or limiting the use of features relying on drop_monitor or related tracing functionalities that invoke trace_drop_common(). 4) Implement kernel crash monitoring and automated recovery mechanisms to minimize downtime in case of kernel panics. 5) Conduct thorough testing of kernel updates in staging environments to ensure compatibility and stability before deployment. 6) Engage with Linux distribution vendors and maintain awareness of security advisories to receive timely updates. 7) For embedded or specialized devices, coordinate with hardware vendors for firmware or kernel updates incorporating the fix. These steps go beyond generic advice by focusing on real-time kernel deployments and emphasizing operational continuity through monitoring and staged patching.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.604Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682cd0fa1484d88663aebff9

Added to database: 5/20/2025, 6:59:06 PM

Last enriched: 7/4/2025, 4:57:25 AM

Last updated: 8/11/2025, 6:10:58 PM

Views: 17

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats