CVE-2026-23161
mm/shmem, swap: fix race of truncate and swap entry split
Mitigation
- Upgrade Linux to 8a1968bd997f45a9b11aefeabdd1232e1b6c7184 or later.
Who should check
- Anyone running Linux >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < a99f9a4669a04662c8f9efe0e62cafc598153139; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < b23bee8cdb7aabce5701a7f57414db5a354ae8ed; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < 8a1968bd997f45a9b11aefeabdd1232e1b6c7184
- Anyone running Linux 6.12
Vulnerability facts
- Affected
- Linux >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < a99f9a4669a04662c8f9efe0e62cafc598153139; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < b23bee8cdb7aabce5701a7f57414db5a354ae8ed; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < 8a1968bd997f45a9b11aefeabdd1232e1b6c7184; Linux 6.12
- Fixed in
- Linux 8a1968bd997f45a9b11aefeabdd1232e1b6c7184
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.3 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: Low
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.15% chance of exploitation in 30 days (percentile 2, 2026-11-26)
- CWE
- CWE-362
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: mm/shmem, swap: fix race of truncate and swap entry split The helper for shmem swap freeing is not handling the order of swap entries correctly. It uses xa_cmpxchg_irq to erase the swap entry, but it gets the entry order before that using xa_get_order without lock protection, and it may get an outdated order value if the entry is split or changed in other ways after the xa_get_order and before the xa_cmpxchg_irq. And besides, the order could grow and be larger than expected, and cause truncation to erase data beyond the end border. For example, if the target entry and following entries are swapped in or freed, then a large folio was added in place and swapped out, using the same entry, the xa_cmpxchg_irq will still succeed, it's very unlikely to happen though. To fix that, open code the Xarray cmpxchg and put the order retrieval and value checking in the same critical section. Also, ensure the order won't exceed the end border, skip it if the entry goes across the border. Skipping large swap entries crosses the end border is safe here. Shmem truncate iterates the range twice, in the first iteration, find_lock_entries already filtered such entries, and shmem will swapin the entries that cross the end border and partially truncate the folio (split the folio or at least zero part of it). So in the second loop here, if we see a swap entry that crosses the end order, it must at least have its content erased already. I observed random swapoff hangs and kernel panics when stress testing ZSWAP with shmem. After applying this patch, all problems are gone.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < a99f9a4669a04662c8f9efe0e62cafc598153139; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < b23bee8cdb7aabce5701a7f57414db5a354ae8ed; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < 8a1968bd997f45a9b11aefeabdd1232e1b6c7184 | — | cvelist |
| Linux | 6.12 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-23161. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-23161.md Affected: Linux >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < a99f9a4669a04662c8f9efe0e62cafc598153139; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < b23bee8cdb7aabce5701a7f57414db5a354ae8ed; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < 8a1968bd997f45a9b11aefeabdd1232e1b6c7184; Linux 6.12 Fixed in: Linux 8a1968bd997f45a9b11aefeabdd1232e1b6c7184 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
FAQ
Is CVE-2026-23161 being exploited?
There is no confirmed exploitation: CVE-2026-23161 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.15% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-23161?
High: CVSS 7.3 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2026-23161?
Linux >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < a99f9a4669a04662c8f9efe0e62cafc598153139; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < b23bee8cdb7aabce5701a7f57414db5a354ae8ed; >= 809bc86517cc408b5b8cb8e08e69096639432bc8, < 8a1968bd997f45a9b11aefeabdd1232e1b6c7184; Linux 6.12.
Is there a fix for CVE-2026-23161?
Yes. Fixed in Linux 8a1968bd997f45a9b11aefeabdd1232e1b6c7184. Upgrade Linux to 8a1968bd997f45a9b11aefeabdd1232e1b6c7184 or later.
How do I check if I'm affected by CVE-2026-23161?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.