CVE-2024-46797

See a problem?
Source
https://nvd.nist.gov/vuln/detail/CVE-2024-46797
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-46797.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-46797
Related
Published
2024-09-18T08:15:06Z
Modified
2024-09-29T16:45:28.125182Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved:

powerpc/qspinlock: Fix deadlock in MCS queue

If an interrupt occurs in queuedspinlockslowpath() after we increment qnodesp->count and before node->lock is initialized, another CPU might see stale lock values in gettail_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] queuedspinlockslowpath+0x1184/0x1490 LR [c000000001037c5c] _rawspinlock+0x6c/0x90 Call Trace: 0xc000002cfffa3bf0 (unreliable) _rawspinlock+0x6c/0x90 rawspinrqlocknested.part.135+0x4c/0xd0 schedttwupending+0x60/0x1f0 _flushsmpcallfunctionqueue+0x1dc/0x670 smpipidemuxrelaxed+0xa4/0x100 xivemuxedipiaction+0x20/0x40 _handleirqeventpercpu+0x80/0x240 handleirqeventpercpu+0x2c/0x80 handlepercpuirq+0x84/0xd0 generichandleirq+0x54/0x80 _doirq+0xac/0x210 _doIRQ+0x74/0xd0 0x0 doIRQ+0x8c/0x170 hardwareinterruptcommonvirt+0x29c/0x2a0 --- interrupt: 500 at queuedspinlockslowpath+0x4b8/0x1490 ...... NIP [c0000000000b6c28] queuedspinlockslowpath+0x4b8/0x1490 LR [c000000001037c5c] _rawspinlock+0x6c/0x90 --- interrupt: 500 0xc0000029c1a41d00 (unreliable) _rawspinlock+0x6c/0x90 futexwake+0x100/0x260 dofutex+0x21c/0x2a0 sysfutex+0x98/0x270 systemcallexception+0x14c/0x2f0 systemcallvectored_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 queuedspinlock_slowpath() function.

    CPU0                                   CPU1
    ----                                   ----

spinlockirqsave(A) | spinunlockirqrestore(A) | spinlock(B) | | | ▼ | id = qnodesp->count++; | (Note that nodes[0].lock == A) | | | ▼ | Interrupt | (happens before "nodes[0].lock = B") | | | ▼ | spinlockirqsave(A) | | | ▼ | id = qnodesp->count++ | nodes[1].lock = A | | | ▼ | Tail of MCS queue | | spinlockirqsave(A) ▼ | Head of MCS queue ▼ | CPU0 is previous tail ▼ | Spin indefinitely ▼ (until "nodes[1].next != NULL") prev = gettail_qnode(A, CPU0) | ▼ prev == &qnodes[CPU0].nodes[0] (as qnodes ---truncated---

References

Affected packages

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.10.11-1

Affected versions

6.*

6.1.27-1
6.1.37-1
6.1.38-1
6.1.38-2~bpo11+1
6.1.38-2
6.1.38-3
6.1.38-4~bpo11+1
6.1.38-4
6.1.52-1
6.1.55-1~bpo11+1
6.1.55-1
6.1.64-1
6.1.66-1
6.1.67-1
6.1.69-1~bpo11+1
6.1.69-1
6.1.76-1~bpo11+1
6.1.76-1
6.1.82-1
6.1.85-1
6.1.90-1~bpo11+1
6.1.90-1
6.1.94-1~bpo11+1
6.1.94-1
6.1.98-1
6.1.99-1
6.1.106-1
6.1.106-2
6.1.106-3
6.3.1-1~exp1
6.3.2-1~exp1
6.3.4-1~exp1
6.3.5-1~exp1
6.3.7-1~bpo12+1
6.3.7-1
6.3.11-1
6.4~rc6-1~exp1
6.4~rc7-1~exp1
6.4.1-1~exp1
6.4.4-1~bpo12+1
6.4.4-1
6.4.4-2
6.4.4-3~bpo12+1
6.4.4-3
6.4.11-1
6.4.13-1
6.5~rc4-1~exp1
6.5~rc6-1~exp1
6.5~rc7-1~exp1
6.5.1-1~exp1
6.5.3-1~bpo12+1
6.5.3-1
6.5.6-1
6.5.8-1
6.5.10-1~bpo12+1
6.5.10-1
6.5.13-1
6.6.3-1~exp1
6.6.4-1~exp1
6.6.7-1~exp1
6.6.8-1
6.6.9-1
6.6.11-1
6.6.13-1~bpo12+1
6.6.13-1
6.6.15-1
6.6.15-2
6.7-1~exp1
6.7.1-1~exp1
6.7.4-1~exp1
6.7.7-1
6.7.9-1
6.7.9-2
6.7.12-1~bpo12+1
6.7.12-1
6.8.9-1
6.8.11-1
6.8.12-1~bpo12+1
6.8.12-1
6.9.2-1~exp1
6.9.7-1~bpo12+1
6.9.7-1
6.9.8-1
6.9.9-1
6.9.10-1~bpo12+1
6.9.10-1
6.9.11-1
6.9.12-1
6.10-1~exp1
6.10.1-1~exp1
6.10.3-1
6.10.4-1
6.10.6-1~bpo12+1
6.10.6-1
6.10.7-1
6.10.9-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}