# CVE-2024-46797: powerpc/qspinlock: Fix deadlock in MCS queue

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-09-18T07:12:51.795Z
- **Modified:** 2026-06-17T07:55:57.253Z

## Who should check

- Anyone running Linux \>= 84990b169557428c318df87b7836cd15f65b62dc, \< d84ab6661e8d09092de9b034b016515ef9b66085; \>= 84990b169557428c318df87b7836cd15f65b62dc, \< f06af737e4be28c0e926dc25d5f0a111da4e2987; \>= 84990b169557428c318df87b7836cd15f65b62dc, \< 734ad0af3609464f8f93e00b6c0de1e112f44559
- Anyone running Linux 6.2

## 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---

## Affected and fixed versions

- Linux: \>= 84990b169557428c318df87b7836cd15f65b62dc, \< d84ab6661e8d09092de9b034b016515ef9b66085; \>= 84990b169557428c318df87b7836cd15f65b62dc, \< f06af737e4be28c0e926dc25d5f0a111da4e2987; \>= 84990b169557428c318df87b7836cd15f65b62dc, \< 734ad0af3609464f8f93e00b6c0de1e112f44559 (cvelist)
- Linux: 6.2 (cvelist)

## Mitigation

- Upgrade Linux to 734ad0af3609464f8f93e00b6c0de1e112f44559 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-46797. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-46797.md
Affected: Linux >= 84990b169557428c318df87b7836cd15f65b62dc, < d84ab6661e8d09092de9b034b016515ef9b66085; >= 84990b169557428c318df87b7836cd15f65b62dc, < f06af737e4be28c0e926dc25d5f0a111da4e2987; >= 84990b169557428c318df87b7836cd15f65b62dc, < 734ad0af3609464f8f93e00b6c0de1e112f44559; Linux 6.2
Fixed in: Linux 734ad0af3609464f8f93e00b6c0de1e112f44559

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-46797 being exploited?

There is no confirmed exploitation: CVE-2024-46797 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-46797?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-46797?

Linux \>= 84990b169557428c318df87b7836cd15f65b62dc, \< d84ab6661e8d09092de9b034b016515ef9b66085; \>= 84990b169557428c318df87b7836cd15f65b62dc, \< f06af737e4be28c0e926dc25d5f0a111da4e2987; \>= 84990b169557428c318df87b7836cd15f65b62dc, \< 734ad0af3609464f8f93e00b6c0de1e112f44559; Linux 6.2.

### Is there a fix for CVE-2024-46797?

Yes. Fixed in Linux 734ad0af3609464f8f93e00b6c0de1e112f44559. Upgrade Linux to 734ad0af3609464f8f93e00b6c0de1e112f44559 or later.

### How do I check if I'm affected by CVE-2024-46797?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/d84ab6661e8d09092de9b034b016515ef9b66085>
- patch: <https://git.kernel.org/stable/c/f06af737e4be28c0e926dc25d5f0a111da4e2987>
- patch: <https://git.kernel.org/stable/c/734ad0af3609464f8f93e00b6c0de1e112f44559>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-46797>

HTML: <https://flawdb.com/CVE-2024-46797> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-46797>
