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.
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon_linux_2023 | — | Upgrade kernel6.12-modules-extra-commonUpgrade perf6.12Upgrade kernel6.12-tools-debuginfoUpgrade kernel-livepatch-6.12.73-95.123Upgrade kernel6.12-debuginfo-common-aarch64Upgrade kernel6.12-headersUpgrade kernel6.12-debuginfoUpgrade kernel6.12-tools-develUpgrade kernel6.12-libbpf-develUpgrade kernel6.12-debuginfo-common-x86_64Upgrade bpftool6.12-debuginfoUpgrade python3-perf6.12Upgrade kernel6.12-toolsUpgrade python3-perf6.12-debuginfoUpgrade kernel6.12-libbpf-debuginfoUpgrade kernel6.12-libbpfUpgrade kernel6.12-modules-extraUpgrade kernel6.12Upgrade kernel6.12-develUpgrade perf6.12-debuginfoUpgrade bpftool6.12Upgrade kernel6.12-libbpf-static | 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-oem-24.04cUpgrade linux-image-oem-6.17Upgrade linux-image-azure-fdeUpgrade linux-image-gcp-64k-6.17Upgrade linux-image-gcp-64kUpgrade linux-image-nvidia-6.17Upgrade linux-image-6.17.0-1021-gcp-64kUpgrade linux-image-6.17.0-1030-oemUpgrade linux-image-azure-6.17Upgrade linux-image-6.17.0-1031-nvidia-64kUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-oracle-6.17Upgrade linux-image-gcp-6.17Upgrade linux-image-nvidia-64k-6.17Upgrade linux-image-6.17.0-1021-gcpUpgrade linux-image-azureUpgrade linux-image-oracle-64k-6.17Upgrade linux-image-nvidia-64k-hwe-24.04Upgrade linux-image-oracle-64kUpgrade linux-image-realtime-6.17Upgrade linux-image-6.17.0-1021-azureUpgrade linux-image-gcpUpgrade linux-image-oracleUpgrade linux-image-6.17.0-1018-azure-fdeUpgrade linux-image-6.17.0-1019-oracle-64kUpgrade linux-image-oem-24.04Upgrade linux-image-6.17.0-1019-oracleUpgrade linux-image-oem-24.04aUpgrade linux-image-oem-24.04bUpgrade linux-image-6.17.0-1031-nvidiaUpgrade linux-image-nvidia-hwe-24.04Upgrade linux-image-6.17.0-1018-realtimeUpgrade linux-image-oem-24.04dUpgrade linux-image-azure-fde-6.17 | Jul 21, 2026 | Jul 20, 2026 |
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