CVE-2026-23161: mm/shmem, swap: fix race of truncate and swap entry split

Published Feb 14, 2026
·
Updated

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 xacmpxchgirq to erase the swap entry, but it gets the entry order before that using xagetorder without lock protection, and it may get an outdated order value if the entry is split or changed in other ways after the xagetorder and before the xacmpxchgirq.

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 xacmpxchgirq 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, findlockentries 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 Software

10 affected components
Linux Linux kernel
Linux Linux kernel>=6.12<6.12.69
Linux Linux kernel>=6.13<6.18.9
Linux Linux kernel=6.19-rc1
Linux Linux kernel=6.19-rc2
Linux Linux kernel=6.19-rc3
Linux Linux kernel=6.19-rc4
Linux Linux kernel=6.19-rc5
Linux Linux kernel=6.19-rc6
Linux Linux kernel=6.19-rc7

Event History

Feb 14, 2026
CVE Published
via MITRE·04:01 PM
Data Sourced
via MITRE·04:01 PM
DescriptionSeverity
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-23161?

The severity of CVE-2026-23161 has not been explicitly rated, but vulnerabilities in the Linux kernel typically carry significant risk due to their potential impact on system security.

2

How do I fix CVE-2026-23161?

To fix CVE-2026-23161, apply the updates or patches provided in the latest Linux kernel release that address this specific vulnerability.

3

What type of systems are affected by CVE-2026-23161?

CVE-2026-23161 affects systems running the Linux kernel, particularly those utilizing memory management features related to shmem and swap.

4

Can CVE-2026-23161 lead to data loss?

Yes, if exploited, CVE-2026-23161 could potentially lead to data loss or corruption due to improper handling of memory management operations.

5

Is there a workaround for CVE-2026-23161?

There is no widely recommended workaround for CVE-2026-23161; patching the kernel is the best course of action.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203