CVE-2026-99738: mm/shmem: preserve allocation errors when swapping in large entries
In the Linux kernel, the following vulnerability has been resolved:
mm/shmem: preserve allocation errors when swapping in large entries
shmemswapinfolio() adjusts swap to the requested slot within a large swap entry before allocating a folio. If allocation or charging fails, the error path compares this adjusted value with the original entry still stored in the XArray in shmemconfirmswap().
Unless the index is at the start of the entry, this turns -ENOMEM into -EEXIST even though nothing changed.
The caller retries -EEXIST, so persistent allocation failures can leave the task spinning instead of returning the error.
Restore swap to indexentry on allocation failure so the existing error path checks the original entry. This preserves the allocation error if the entry is unchanged and still retries if it changed concurrently.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What conditions are required to trigger the task spin?
A swap-in of a large swap entry must request an index that is not at the start of that entry, and folio allocation or memory charging must fail persistently. Under those conditions, the failure can be misreported as -EEXIST and retried repeatedly.
What is the operational impact of this issue?
A task encountering persistent allocation or charging failures while swapping in the affected large entries may spin instead of receiving the allocation error. This can prevent the affected operation from making progress while the failure persists.
How does the fix change behavior during concurrent changes?
On allocation failure, the fix restores the original swap entry before the existing validation path runs. It preserves the allocation error when the entry is unchanged, while retaining retry behavior if the entry changed concurrently.