# CVE-2026-99666: mm/khugepaged: fix PMD table lock leak in try_collapse_pte_mapped_thp()

- 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:50:16.494Z
- Modified: 2026-11-20T06:18:00.903Z
- Assigned by: Linux

## Description

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

mm/khugepaged: fix PMD table lock leak in try_collapse_pte_mapped_thp()

For a private mapping with userfaultfd, try_collapse_pte_mapped_thp()
takes the PMD table lock before it maps the page table for the second time.
If that (pte_offset_map_rw_nolock) fails, because the page table vanished
in the meantime due to concurrent page table reclaim, it leaves through
the abort label, where the PMD table lock is unlocked if it differs from
PTE table lock.

In case the PMD table lock and the PTE table lock match, which is the
case without CONFIG_SPLIT_PTE_PTLOCKS after pte_offset_map_rw_nolock()
failed, we miss to unlock the PMD table.

To fix it, forget the PTE table lock when we unmap+unlock the PTE table.

Fix generated by an LLM and sent by Josef Bacik in private.

[ david: move the ptl = NULL handling; rewrite description, drop wrong comments ]

(As written by CVE List.)

## Affected

- Linux Linux: from 6375e95f381e3dc85065b6f74263a61522736203 before 7c1170ce1b74a8cd83da2174a3eb9e0755bb1b16; from 6375e95f381e3dc85065b6f74263a61522736203 before ad5e5800ce560759c8d3c10aac15b48a06cd21c1; from 6375e95f381e3dc85065b6f74263a61522736203 before db38b902307e687219ec765ef51a6ef459746c87; 6.14 (not affected: before 6.14; from 6.18.64 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/7c1170ce1b74a8cd83da2174a3eb9e0755bb1b16>
- <https://git.kernel.org/stable/c/ad5e5800ce560759c8d3c10aac15b48a06cd21c1>
- <https://git.kernel.org/stable/c/db38b902307e687219ec765ef51a6ef459746c87>

## Sources

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

---

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