Skip to main content

CVE-2024-46797: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-46797cvecve-2024-46797
Published: Wed Sep 18 2024 (09/18/2024, 07:12:51 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: powerpc/qspinlock: Fix deadlock in MCS queue If an interrupt occurs in queued_spin_lock_slowpath() after we increment qnodesp->count and before node->lock is initialized, another CPU might see stale lock values in get_tail_qnode(). If the stale lock value happens to match the lock on that CPU, then we write to the "next" pointer of the wrong qnode. This causes a deadlock as the former CPU, once it becomes the head of the MCS queue, will spin indefinitely until it's "next" pointer is set by its successor in the queue. Running stress-ng on a 16 core (16EC/16VP) shared LPAR, results in occasional lockups similar to the following: $ stress-ng --all 128 --vm-bytes 80% --aggressive \ --maximize --oomable --verify --syslog \ --metrics --times --timeout 5m watchdog: CPU 15 Hard LOCKUP ...... NIP [c0000000000b78f4] queued_spin_lock_slowpath+0x1184/0x1490 LR [c000000001037c5c] _raw_spin_lock+0x6c/0x90 Call Trace: 0xc000002cfffa3bf0 (unreliable) _raw_spin_lock+0x6c/0x90 raw_spin_rq_lock_nested.part.135+0x4c/0xd0 sched_ttwu_pending+0x60/0x1f0 __flush_smp_call_function_queue+0x1dc/0x670 smp_ipi_demux_relaxed+0xa4/0x100 xive_muxed_ipi_action+0x20/0x40 __handle_irq_event_percpu+0x80/0x240 handle_irq_event_percpu+0x2c/0x80 handle_percpu_irq+0x84/0xd0 generic_handle_irq+0x54/0x80 __do_irq+0xac/0x210 __do_IRQ+0x74/0xd0 0x0 do_IRQ+0x8c/0x170 hardware_interrupt_common_virt+0x29c/0x2a0 --- interrupt: 500 at queued_spin_lock_slowpath+0x4b8/0x1490 ...... NIP [c0000000000b6c28] queued_spin_lock_slowpath+0x4b8/0x1490 LR [c000000001037c5c] _raw_spin_lock+0x6c/0x90 --- interrupt: 500 0xc0000029c1a41d00 (unreliable) _raw_spin_lock+0x6c/0x90 futex_wake+0x100/0x260 do_futex+0x21c/0x2a0 sys_futex+0x98/0x270 system_call_exception+0x14c/0x2f0 system_call_vectored_common+0x15c/0x2ec The following code flow illustrates how the deadlock occurs. For the sake of brevity, assume that both locks (A and B) are contended and we call the queued_spin_lock_slowpath() function. CPU0 CPU1 ---- ---- spin_lock_irqsave(A) | spin_unlock_irqrestore(A) | spin_lock(B) | | | ▼ | id = qnodesp->count++; | (Note that nodes[0].lock == A) | | | ▼ | Interrupt | (happens before "nodes[0].lock = B") | | | ▼ | spin_lock_irqsave(A) | | | ▼ | id = qnodesp->count++ | nodes[1].lock = A | | | ▼ | Tail of MCS queue | | spin_lock_irqsave(A) ▼ | Head of MCS queue ▼ | CPU0 is previous tail ▼ | Spin indefinitely ▼ (until "nodes[1].next != NULL") prev = get_tail_qnode(A, CPU0) | ▼ prev == &qnodes[CPU0].nodes[0] (as qnodes ---truncated---

AI-Powered Analysis

AILast updated: 06/29/2025, 01:56:11 UTC

Technical Analysis

CVE-2024-46797 is a vulnerability in the Linux kernel's powerpc architecture implementation of queued spinlocks (qspinlock), specifically in the MCS (Mellor-Crummey and Scott) queue locking mechanism. The issue arises in the function queued_spin_lock_slowpath() when an interrupt occurs after the increment of the qnodesp->count but before the initialization of the node->lock. This timing window can cause another CPU to observe stale lock values in get_tail_qnode(). If the stale lock value matches the lock held by that CPU, it results in writing to the "next" pointer of an incorrect qnode. Consequently, this leads to a deadlock where the CPU that becomes the head of the MCS queue spins indefinitely, waiting for its "next" pointer to be set by a successor that never arrives. This deadlock manifests as a hard lockup, as demonstrated by stress-ng tests on a 16-core shared logical partition (LPAR), causing CPUs to hang and the system to become unresponsive. The vulnerability is rooted in a race condition triggered by interrupts during lock acquisition, causing inconsistent queue states and indefinite spinning. The vulnerability affects Linux kernel versions identified by the commit hash 84990b169557428c318df87b7836cd15f65b62dc and has been publicly disclosed without an assigned CVSS score. No known exploits are reported in the wild yet. The issue is specific to the powerpc architecture's queued spinlock implementation and impacts kernel synchronization primitives critical for multiprocessor concurrency control.

Potential Impact

For European organizations running Linux systems on powerpc architectures, especially in high-performance computing, virtualization, or enterprise server environments, this vulnerability can cause system-wide deadlocks leading to hard CPU lockups. This results in denial of service (DoS) conditions where affected systems become unresponsive, potentially disrupting critical business operations, cloud services, or data center workloads. The deadlock can degrade system availability and reliability, impacting service level agreements (SLAs) and operational continuity. Since the vulnerability occurs at the kernel synchronization level, it can affect any multi-core system using the vulnerable kernel versions, including virtualized environments and shared logical partitions common in enterprise data centers. Although no direct confidentiality or integrity compromise is indicated, the availability impact is significant. European organizations relying on Linux-based infrastructure for critical applications, especially those using powerpc hardware or specialized embedded systems, are at risk of operational disruption. The lack of known exploits reduces immediate risk, but the potential for denial of service in production environments warrants urgent mitigation.

Mitigation Recommendations

1. Immediate application of the official Linux kernel patch that fixes the deadlock in the powerpc qspinlock implementation is essential. Organizations should track kernel updates from trusted Linux distributions and apply security patches promptly. 2. For environments where patching is delayed, consider isolating or limiting workloads on affected powerpc systems to reduce concurrency and interrupt load, mitigating the race condition trigger. 3. Implement monitoring for CPU hard lockups and kernel hangs using system telemetry and watchdog timers to detect symptoms early and trigger automated recovery or alerts. 4. In virtualized or shared LPAR environments, carefully manage CPU allocation and interrupt handling to minimize contention on spinlocks. 5. Engage with hardware and Linux distribution vendors to confirm the presence of the fix and receive guidance on backported patches or mitigations. 6. Conduct thorough testing of kernel updates in staging environments to ensure stability before production deployment. 7. Maintain robust backup and recovery procedures to minimize downtime in case of system lockups. 8. Review and update incident response plans to include scenarios involving kernel-level deadlocks and system hangs.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-09-11T15:12:18.280Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe1341

Added to database: 5/21/2025, 9:08:55 AM

Last enriched: 6/29/2025, 1:56:11 AM

Last updated: 8/7/2025, 9:46:51 PM

Views: 16

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