# CVE-2026-99738: mm/shmem: preserve allocation errors when swapping in large entries

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-01)
- Published: 2026-11-20T05:51:11.250Z
- Modified: 2026-11-23T08:18:14.143Z
- Assigned by: Linux

## Description

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

mm/shmem: preserve allocation errors when swapping in large entries

shmem_swapin_folio() 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 shmem_confirm_swap().

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 index_entry 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 91ab656ece137c368a3189dfd42f8c9203a6285c before 265dfa2525817d3be437576505186beb623384bf; from 91ab656ece137c368a3189dfd42f8c9203a6285c before 680afc486db200e7b08307cb28be4f90766afcff; from 91ab656ece137c368a3189dfd42f8c9203a6285c before f4ce23b1feef16d435aa1188b6c2a637a5373ed5; 6.17 (not affected: before 6.17; from 6.18.65 up to 6.18.*; from 7.3.5 up to 7.3.*; from 7.4-rc2 up to *)

## References

- <https://git.kernel.org/stable/c/265dfa2525817d3be437576505186beb623384bf>
- <https://git.kernel.org/stable/c/680afc486db200e7b08307cb28be4f90766afcff>
- <https://git.kernel.org/stable/c/f4ce23b1feef16d435aa1188b6c2a637a5373ed5>

## Sources

- CVE List: [CVE-2026-99738](https://www.cve.org/CVERecord?id=CVE-2026-99738), CVE Terms of Use, modified 2026-11-23
- NVD: [CVE-2026-99738](https://nvd.nist.gov/vuln/detail/CVE-2026-99738), Public domain, modified 2026-11-23

---

Page: https://cve.day/CVE-2026-99738 · Whole record: https://cve.day/CVE-2026-99738.json · Rebuilt by cve.day 2026-11-25T22:59:52.326Z
