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.
CVSS Details
- CVSS 3.1 Base Score: 7.3
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon_linux_2023 | — | Upgrade python3-perf6.12-debuginfoUpgrade kernel6.12-libbpf-develUpgrade bpftool6.12Upgrade perf6.12-debuginfoUpgrade kernel6.12-debuginfo-common-x86_64Upgrade kernel6.12Upgrade kernel6.12-develUpgrade bpftool6.12-debuginfoUpgrade kernel6.12-libbpf-staticUpgrade kernel6.12-tools-develUpgrade kernel6.12-toolsUpgrade kernel6.12-libbpfUpgrade kernel6.12-libbpf-debuginfoUpgrade kernel6.12-modules-extraUpgrade python3-perf6.12Upgrade kernel6.12-modules-extra-commonUpgrade kernel6.12-tools-debuginfoUpgrade kernel6.12-debuginfo-common-aarch64Upgrade perf6.12Upgrade kernel-livepatch-6.12.73-95.123Upgrade kernel6.12-headersUpgrade kernel6.12-debuginfo | Mar 27, 2026 | Feb 14, 2026 |
| Debian | — | Upgrade linux | Jul 23, 2026 | Jul 23, 2026 |
| Oracle_linux | — | Upgrade kernel-uek | Mar 25, 2026 | Feb 14, 2026 |
| Redhat_linux | — | No solution exists | Jul 17, 2026 | Feb 14, 2026 |
| Ubuntu | — | Upgrade linux-image-azure-6.17Upgrade linux-image-6.17.0-1031-nvidia-64kUpgrade linux-image-azureUpgrade linux-image-oracle-6.17Upgrade linux-image-oracle-64k-6.17Upgrade linux-image-nvidia-64k-6.17Upgrade linux-image-oem-6.17Upgrade linux-image-oem-24.04cUpgrade linux-image-azure-fdeUpgrade linux-image-gcp-64k-6.17Upgrade linux-image-realtime-hwe-24.04Upgrade linux-image-nvidia-6.17Upgrade linux-image-gcp-64kUpgrade linux-image-6.17.0-1030-oemUpgrade linux-image-gcp-6.17Upgrade linux-image-6.17.0-1021-gcpUpgrade linux-image-6.17.0-1021-gcp-64kUpgrade linux-image-oem-24.04bUpgrade linux-image-oem-24.04aUpgrade linux-image-6.17.0-1019-oracleUpgrade linux-image-oem-24.04dUpgrade linux-image-azure-fde-6.17Upgrade linux-image-gcpUpgrade linux-image-6.17.0-1021-azureUpgrade linux-image-nvidia-hwe-24.04Upgrade linux-image-oracle-64kUpgrade linux-image-6.17.0-1018-realtimeUpgrade linux-image-oracleUpgrade linux-image-realtime-6.17Upgrade linux-image-6.17.0-1018-azure-fdeUpgrade linux-image-nvidia-64k-hwe-24.04Upgrade linux-image-6.17.0-1031-nvidiaUpgrade linux-image-6.17.0-1019-oracle-64kUpgrade linux-image-oem-24.04 | Jul 21, 2026 | Jul 20, 2026 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub