Skip to content
OpenAdvisories
High · 7.3 CVE-2026-23161 EUVD-2026-5877GHSA-4rgv-cpg8-f3hr

mm/shmem, swap: fix race of truncate and swap entry split

Published Feb 14, 2026 · Updated Aug 5, 2026 · Assigned by Linux

Vendor: Linux Product: Linux Package: linux Package: linux Package: linux-allwinner-5.19 Package: linux-aws Package: linux-aws-5.0 Package: linux-aws-5.11 Package: linux-aws-5.13 Package: linux-aws-5.19 Package: linux-aws-5.3 Package: linux-aws-5.8 Package: linux-aws-6.14 Package: linux-aws-6.17 Package: linux-aws-6.2 Package: linux-aws-6.5 Package: linux-azure Package: linux-azure-5.11 Package: linux-azure-5.13 Package: linux-azure-5.19 Package: linux-azure-5.3 Package: linux-azure-5.8 Package: linux-azure-6.11 Package: linux-azure-6.14 Package: linux-azure-6.17 Package: linux-azure-6.2 Package: linux-azure-6.5 Package: linux-azure-edge Package: linux-azure-fde Package: linux-azure-fde-5.19 Package: linux-azure-fde-6.14 Package: linux-azure-fde-6.2 Package: linux-azure-nvidia-6.14 Package: linux-gcp Package: linux-gcp-5.11 Package: linux-gcp-5.13 Package: linux-gcp-5.19 Package: linux-gcp-5.3 Package: linux-gcp-5.8 Package: linux-gcp-6.11 Package: linux-gcp-6.14 Package: linux-gcp-6.17 Package: linux-gcp-6.2 Package: linux-gcp-6.5 Package: linux-gke Package: linux-gke-4.15 Package: linux-gke-5.15 Package: linux-gke-5.4 Package: linux-gkeop Package: linux-gkeop-5.15 Package: linux-gkeop-5.4 Package: linux-hwe Package: linux-hwe-5.11 Package: linux-hwe-5.13 Package: linux-hwe-5.19 Package: linux-hwe-5.8 Package: linux-hwe-6.11 Package: linux-hwe-6.14 Package: linux-hwe-6.17 Package: linux-hwe-6.2 Package: linux-hwe-6.5 Package: linux-hwe-edge Package: linux-intel-5.13 Package: linux-intel-iot-realtime Package: linux-lowlatency-hwe-5.19 Package: linux-lowlatency-hwe-6.11 Package: linux-lowlatency-hwe-6.2 Package: linux-lowlatency-hwe-6.5 Package: linux-nvidia-6.11 Package: linux-nvidia-6.17 Package: linux-nvidia-6.2 Package: linux-nvidia-6.5 Package: linux-oem Package: linux-oem-5.10 Package: linux-oem-5.13 Package: linux-oem-5.14 Package: linux-oem-5.17 Package: linux-oem-5.6 Package: linux-oem-6.0 Package: linux-oem-6.1 Package: linux-oem-6.11 Package: linux-oem-6.14 Package: linux-oem-6.17 Package: linux-oem-6.5 Package: linux-oem-6.8 Package: linux-oracle Package: linux-oracle-5.0 Package: linux-oracle-5.11 Package: linux-oracle-5.13 Package: linux-oracle-5.3 Package: linux-oracle-5.8 Package: linux-oracle-6.14 Package: linux-oracle-6.17 Package: linux-oracle-6.5 Package: linux-raspi Package: linux-raspi-realtime Package: linux-raspi2 Package: linux-realtime Package: linux-realtime-6.14 Package: linux-realtime-6.17 Package: linux-riscv Package: linux-riscv-5.11 Package: linux-riscv-5.19 Package: linux-riscv-5.8 Package: linux-riscv-6.14 Package: linux-riscv-6.17 Package: linux-riscv-6.5 Package: linux-starfive-5.19 Package: linux-starfive-6.2 Package: linux-starfive-6.5 Platform: Linux Ecosystem: Debian Ecosystem: Ubuntu

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 products

VendorProductAffectedFixed
Linux Linux 6.12 6.12.69

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 linux 6.18.9-1 —
Debian 13 linux 6.12.69-1 —
ReleasePackageFixed inAdvisory
Ubuntu 25.10 linux +8 No fix yet —
Ubuntu 24.04 LTS linux-azure-6.17 6.17.0-1021.21~24.04.1 USN-8604-1
Ubuntu 24.04 LTS linux-azure-fde-6.17 6.17.0-1018.18~24.04.1 USN-8605-1
Ubuntu 24.04 LTS linux-gcp-6.17 6.17.0-1021.24~24.04.1 USN-8570-1
Ubuntu 24.04 LTS linux-hwe-6.17 6.17.0-41.41~24.04.1 —
Ubuntu 24.04 LTS linux-nvidia-6.17 6.17.0-1031.31 USN-8669-1
Ubuntu 24.04 LTS linux-oem-6.17 6.17.0-1030.30 USN-8594-1
Ubuntu 24.04 LTS linux-oracle-6.17 6.17.0-1019.19~24.04.3 USN-8570-2
Ubuntu 24.04 LTS linux-riscv +20 No fix yet —
Ubuntu 22.04 LTS linux-riscv +32 No fix yet —
Ubuntu 20.04 LTS linux-gke +28 No fix yet —
Ubuntu 18.04 LTS linux-gcp +14 No fix yet —
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 16.04 LTS linux-hwe-edge No fix yet —
Ubuntu Pro Realtime 24.04 LTS linux-realtime-6.14 No fix yet —
Ubuntu Pro Realtime 24.04 LTS linux-realtime-6.17 6.17.0-1018.20~24.04.1 USN-8570-1
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 kernel-64kb +8 6.12.0-160000.27.1 SUSE-SU-2026:20931-1
SLES for SAP 16.0 kernel-default-base 6.12.0-160000.27.1.160000.2.8 SUSE-SU-2026:20931-1
SLES for SAP 16.0 kernel-livepatch-SLE16_Update_0 17-160000.4.3 SUSE-SU-2026:23341-1
SLES for SAP 16.0 kernel-livepatch-SLE16_Update_1 15-160000.1.1 SUSE-SU-2026:23343-1
SLES for SAP 16.0 kernel-livepatch-SLE16_Update_2 13-160000.1.1 SUSE-SU-2026:23340-1
SLES for SAP 16.0 kernel-livepatch-SLE16_Update_3 12-160000.1.1 SUSE-SU-2026:23339-1
SLES for SAP 16.0 kernel-livepatch-SLE16_Update_4 11-160000.1.1 SUSE-SU-2026:23338-1
SLES for SAP 16.0 kernel-livepatch-SLE16_Update_5 10-160000.1.1 SUSE-SU-2026:23337-1
SLES 16.0 kernel-64kb +8 6.12.0-160000.27.1 SUSE-SU-2026:20931-1
SLES 16.0 kernel-default-base 6.12.0-160000.27.1.160000.2.8 SUSE-SU-2026:20931-1
SLES 16.0 kernel-livepatch-SLE16_Update_0 17-160000.4.3 SUSE-SU-2026:23341-1
SLES 16.0 kernel-livepatch-SLE16_Update_1 15-160000.1.1 SUSE-SU-2026:23343-1
SLES 16.0 kernel-livepatch-SLE16_Update_2 13-160000.1.1 SUSE-SU-2026:23340-1
SLES 16.0 kernel-livepatch-SLE16_Update_3 12-160000.1.1 SUSE-SU-2026:23339-1
SLES 16.0 kernel-livepatch-SLE16_Update_4 11-160000.1.1 SUSE-SU-2026:23338-1
SLES 16.0 kernel-livepatch-SLE16_Update_5 10-160000.1.1 SUSE-SU-2026:23337-1
SLE Micro 6.2 kernel-default-base 6.12.0-160000.27.1.160000.2.8 SUSE-SU-2026:20838-1
SLE Micro 6.2 kernel-livepatch-SLE16-RT_Update_0 15-160000.3.4 SUSE-SU-2026:23272-1
SLE Micro 6.2 kernel-livepatch-SLE16-RT_Update_1 14-160000.1.1 SUSE-SU-2026:23271-1
SLE Micro 6.2 kernel-livepatch-SLE16_Update_0 17-160000.4.3 SUSE-SU-2026:23293-1
SLE Micro 6.2 kernel-livepatch-SLE16_Update_1 15-160000.1.1 SUSE-SU-2026:23296-1
SLE Micro 6.2 kernel-livepatch-SLE16_Update_2 13-160000.1.1 SUSE-SU-2026:23292-1
SLE Micro 6.2 kernel-livepatch-SLE16_Update_3 +1 12-160000.1.1 SUSE-SU-2026:23291-1, SUSE-SU-2026:23270-1
SLE Micro 6.2 kernel-livepatch-SLE16_Update_4 +2 11-160000.1.1 SUSE-SU-2026:23290-1, SUSE-SU-2026:23269-1, SUSE-SU-2026:23268-1
SLE Micro 6.2 kernel-livepatch-SLE16_Update_5 +1 10-160000.1.1 SUSE-SU-2026:23288-1, SUSE-SU-2026:23267-1
SLE Micro 6.2 kernel-rt +5 6.12.0-160000.27.1 SUSE-SU-2026:20873-1, SUSE-SU-2026:20838-1
ReleasePackageFixed inAdvisory
openSUSE Leap 16.0 kernel-default-base 6.12.0-160000.27.1.160000.2.8 openSUSE-SU-2026:20416-1
openSUSE Leap 16.0 kernel-rt +11 6.12.0-160000.27.1 openSUSE-SU-2026:20416-1

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 kernel-livepatch-6.12.73-95.123 1:1.0-0.amzn2023 ALAS2023-2026-1487
Amazon Linux 2023 perf6.12 +14 1:6.12.73-95.123.amzn2023 ALAS2023-2026-1487

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 kernel-uek +34 6.12.0-200.74.27.el10uek ELSA-2026-50372, ELSA-2026-50232, ELSA-2026-50160

Advisories 33

References