CVE-2024-31076

Source
https://cve.org/CVERecord?id=CVE-2024-31076
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-31076.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-31076
Downstream
Related
Published
2024-06-21T10:18:04.335Z
Modified
2026-03-14T12:28:17.080883Z
Summary
genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline
Details

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

genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline

The absence of IRQDMOVEPCNTXT prevents immediate effectiveness of interrupt affinity reconfiguration via procfs. Instead, the change is deferred until the next instance of the interrupt being triggered on the original CPU.

When the interrupt next triggers on the original CPU, the new affinity is enforced within __irqmoveirq(). A vector is allocated from the new CPU, but the old vector on the original CPU remains and is not immediately reclaimed. Instead, apicd->moveinprogress is flagged, and the reclaiming process is delayed until the next trigger of the interrupt on the new CPU.

Upon the subsequent triggering of the interrupt on the new CPU, irqcompletemove() adds a task to the old CPU's vectorcleanup list if it remains online. Subsequently, the timer on the old CPU iterates over its vectorcleanup list, reclaiming old vectors.

However, a rare scenario arises if the old CPU is outgoing before the interrupt triggers again on the new CPU.

In that case irqforcecompletemove() is not invoked on the outgoing CPU to reclaim the old apicd->prevvector because the interrupt isn't currently affine to the outgoing CPU, and irqneedsfixup() returns false. Even though __vectorschedulecleanup() is later called on the new CPU, it doesn't reclaim apicd->prevvector; instead, it simply resets both apicd->moveinprogress and apicd->prevvector to 0.

As a result, the vector remains unreclaimed in vector_matrix, leading to a CPU vector leak.

To address this issue, move the invocation of irqforcecompletemove() before the irqneedsfixup() call to reclaim apicd->prevvector, if the interrupt is currently or used to be affine to the outgoing CPU.

Additionally, reclaim the vector in _vectorschedulecleanup() as well, following a warning message, although theoretically it should never see apicd->moveinprogress with apicd->prevcpu pointing to an offline CPU.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/31xxx/CVE-2024-31076.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f0383c24b4855f6a4b5a358c7b2d2c16e0437e9b
Fixed
a40209d355afe4ed6d533507838c9e5cd70a76d8
Fixed
f5f4675960609d8c5ee95f027fbf6ce380f98372
Fixed
6752dfcfff3ac3e16625ebd3f0ad9630900e7e76
Fixed
9eeda3e0071a329af1eba15f4e57dc39576bb420
Fixed
e9c96d01d520498b169ce734a8ad1142bef86a30
Fixed
59f86a2908380d09cdc726461c0fbb8d8579c99f
Fixed
ebfb16fc057a016abb46a9720a54abf0d4f6abe1
Fixed
a6c11c0a5235fb144a65e0cb2ffd360ddc1f6c32

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-31076.json"