Description
In the Linux kernel, the following vulnerability has been resolved:
ksm: use range-walk function to jump over holes in scan_get_next_rmap_item
Currently, scan_get_next_rmap_item() walks every page address in a VMA to
locate mergeable pages. This becomes highly inefficient when scanning
large virtual memory areas that contain mostly unmapped regions, causing
ksmd to use large amount of cpu without deduplicating much pages.
This patch replaces the per-address lookup with a range walk using
walk_page_range(). The range walker allows KSM to skip over entire
unmapped holes in a VMA, avoiding unnecessary lookups. This problem was
previously discussed in [1].
Consider the following test program which creates a 32 TiB mapping in the
virtual address space but only populates a single page:
#include <unistd.h>
#include <stdio.h>
#include <sys/mman.h>
/* 32 TiB */
const size_t size = 32ul * 1024 * 1024 * 1024 * 1024;
int main() {
char *area = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1, 0);
if (area == MAP_FAILED) {
perror("mmap() failed\n");
return -1;
}
/* Populate a single page such that we get an anon_vma. */
*area = 0;
/* Enable KSM. */
madvise(area, size, MADV_MERGEABLE);
pause();
return 0;
}
$ ./ksm-sparse &
$ echo 1 > /sys/kernel/mm/ksm/run
Without this patch ksmd uses 100% of the cpu for a long time (more then 1
hour in my test machine) scanning all the 32 TiB virtual address space
that contain only one mapped page. This makes ksmd essentially deadlocked
not able to deduplicate anything of value. With this patch ksmd walks
only the one mapped page and skips the rest of the 32 TiB virtual address
space, making the scan fast using little cpu.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 2.6.32 | 5.10.249 |
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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | linux | 6.17.9-1 | — |
| Debian 13 | linux | 6.12.63-1 | — |
| Debian 12 | linux | 6.1.162-1 | DSA-6127-1 |
| Debian 11 | linux | 5.10.249-1 | DLA-4475-1 |
| Debian 11 | linux-6.1 | 6.1.162-1~deb11u1 | DLA-4476-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Nvidia-BlueField 24.04 LTS | linux-bluefield | No fix yet | — |
| Ubuntu Nvidia-BlueField 22.04 LTS | linux-bluefield | 5.15.0-1089.91 | — |
| Ubuntu 25.10 | linux | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu 25.10 | linux-aws +2 | 6.17.0-1007.7 | USN-8030-1, USN-8029-2 |
| Ubuntu 25.10 | linux-azure +1 | 6.17.0-1008.8 | USN-8029-3, USN-8029-1 |
| Ubuntu 25.10 | linux-azure-fde | No fix yet | — |
| Ubuntu 25.10 | linux-realtime | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu 25.10 | linux-riscv | 6.17.0-14.14.1 | — |
| Ubuntu 24.04 LTS | linux +36 | No fix yet | — |
| Ubuntu 24.04 LTS | linux-aws-6.17 +1 | 6.17.0-1007.7~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-gcp-6.17 | 6.17.0-1008.8~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-nvidia-6.17 | 6.17.0-1008.8 | — |
| Ubuntu 24.04 LTS | linux-oem-6.17 | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu 22.04 LTS | linux | 5.15.0-176.186 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-aws | 5.15.0-1105.112 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-azure | 5.15.0-1110.119 | USN-8180-3 |
| Ubuntu 22.04 LTS | linux-azure-fde | 5.15.0-1114.123 | — |
| Ubuntu 22.04 LTS | linux-gcp | 5.15.0-1105.114 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-gke | 5.15.0-1101.107 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-gkeop | 5.15.0-1088.96 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-ibm +1 | 5.15.0-1099.102 | USN-8180-6, USN-8180-5 |
| Ubuntu 22.04 LTS | linux-intel-iotg | 5.15.0-1100.106 | USN-8180-3 |
| Ubuntu 22.04 LTS | linux-kvm | 5.15.0-1097.102 | USN-8180-3 |
| Ubuntu 22.04 LTS | linux-lowlatency | 5.15.0-175.185 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-nvidia | 5.15.0-1100.101 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-nvidia-tegra | 5.15.0-1057.57 | USN-8187-1 |
| Ubuntu 22.04 LTS | linux-nvidia-tegra-igx | 5.15.0-1046.46 | USN-8187-1 |
| Ubuntu 22.04 LTS | linux-oracle | 5.15.0-1102.108 | USN-8180-1 |
| Ubuntu 22.04 LTS | linux-riscv +42 | No fix yet | — |
| Ubuntu 22.04 LTS | linux-xilinx-zynqmp | 5.15.0-1070.74 | USN-8275-1 |
Show 18 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | linux-gke +28 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-gcp +14 | No fix yet | — |
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime +2 | No fix yet | — |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime-6.17 | 6.17.0-1006.7~24.04.1 | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-intel-iot-realtime | 5.15.0-1097.99 | USN-8186-1 |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime | 5.15.0-1104.113 | USN-8186-1 |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime-6.8 | No fix yet | — |
| Ubuntu Pro FIPS 20.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS 18.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS 16.04 LTS | linux-fips | No fix yet | — |
| Ubuntu Pro FIPS-updates 24.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-aws-fips | 5.15.0-1105.112+fips1 | — |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-azure-fips | 5.15.0-1110.119+fips1 | USN-8180-4 |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-fips | 5.15.0-176.186+fips1 | USN-8180-2 |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-gcp-fips | 5.15.0-1105.114+fips1 | USN-8180-2 |
| Ubuntu Pro FIPS-updates 20.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 18.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 16.04 LTS | linux-fips | No fix yet | — |
| Ubuntu Pro FIPS-preview 22.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro 20.04 LTS | linux +10 | No fix yet | — |
| Ubuntu Pro 20.04 LTS | linux-aws-5.15 | 5.15.0-1105.112~20.04.1 | USN-8180-1 |
| Ubuntu Pro 20.04 LTS | linux-azure-5.15 | 5.15.0-1110.119~20.04.1 | USN-8243-1 |
| Ubuntu Pro 20.04 LTS | linux-gcp-5.15 | 5.15.0-1106.115~20.04.1 | USN-8297-1 |
| Ubuntu Pro 20.04 LTS | linux-hwe-5.15 | 5.15.0-176.186~20.04.1 | USN-8188-1 |
| Ubuntu Pro 20.04 LTS | linux-ibm-5.15 | 5.15.0-1099.102~20.04.1 | USN-8180-5 |
| Ubuntu Pro 20.04 LTS | linux-intel-iotg-5.15 | 5.15.0-1100.106~20.04.1 | USN-8180-3 |
| Ubuntu Pro 20.04 LTS | linux-lowlatency-hwe-5.15 | 5.15.0-175.185~20.04.1 | USN-8180-1 |
| Ubuntu Pro 20.04 LTS | linux-nvidia-tegra-5.15 | 5.15.0-1057.57~20.04.1 | USN-8162-1 |
| Ubuntu Pro 20.04 LTS | linux-oracle-5.15 | 5.15.0-1102.108~20.04.1 | USN-8180-3 |
| Ubuntu Pro 20.04 LTS | linux-riscv-5.15 | 5.15.0-1099.103~20.04.1 | — |
| Ubuntu Pro 18.04 LTS | linux +12 | No fix yet | — |
| Ubuntu Pro 16.04 LTS | linux +7 | No fix yet | — |
| Ubuntu Pro 14.04 LTS | linux +3 | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 10 | rv +76 | 6.12.0-211.42.1.el10_2 | RHSA-2026:49211 |
| RHEL 9 | rv +75 | 5.14.0-687.42.1.el9_8 | RHSA-2026:59723 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9.6 EUS | rv +77 | 5.14.0-570.138.1.el9_6 | RHSA-2026:62568 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 10 | rv +74 | 6.12.0-211.42.1.el10_2 | ALSA-2026:49211 |
| AlmaLinux 9 | rv +73 | 5.14.0-687.42.1.el9_8 | ALSA-2026:59723 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 10 | kernel | 6.12.0-211.42.1.el10_2 | RLSA-2026:49211 |
| Rocky Linux 9 | kernel | 5.14.0-687.42.1.el9_8 | RLSA-2026:59723 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | kernel-64kb +8 | 6.12.0-160000.26.1 | SUSE-SU-2026:20599-1 |
| SLES for SAP 16.0 | kernel-default-base | 6.12.0-160000.26.1.160000.2.7 | SUSE-SU-2026:20599-1 |
| SLES 16.0 | kernel-64kb +8 | 6.12.0-160000.26.1 | SUSE-SU-2026:20615-1, SUSE-SU-2026:20599-1 |
| SLES 16.0 | kernel-default-base | 6.12.0-160000.26.1.160000.2.7 | SUSE-SU-2026:20599-1 |
| SLE Micro 6.2 | kernel-default-base | 6.12.0-160000.26.1.160000.2.7 | SUSE-SU-2026:20555-1 |
| SLE Micro 6.2 | kernel-rt +5 | 6.12.0-160000.26.1 | SUSE-SU-2026:20570-1, SUSE-SU-2026:20555-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 16.0 | kernel-default-base | 6.12.0-160000.26.1.160000.2.7 | openSUSE-SU-2026:20287-1 |
| openSUSE Leap 16.0 | kernel-rt +11 | 6.12.0-160000.26.1 | openSUSE-SU-2026:20287-1 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | kernel | 6.6.121.1-1 | — |
| Azure Linux 2 (CBL-Mariner) | kernel | 5.15.200.1-1 | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 10 | rv +29 | 6.12.0-211.42.1.el10_2 | ELSA-2026-49211 |
| Oracle Linux 9 | kernel-uek +34 | 6.12.0-107.59.3.2.el10uek | ELSA-2026-50006 |
| Oracle Linux 9 | rv +28 | 5.14.0-687.42.1.el9_8 | ELSA-2026-59723 |
| Oracle Linux 8 | bpftool +18 | 5.15.0-318.199.3.2.el9uek | ELSA-2026-50145 |
Advisories 40
- WID-SEC-2025-2868 Linux Kernel: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 12, 2026
- USN-8180-1 linux, linux-aws, linux-aws-5.15, linux-gcp, linux-gke, linux-gkeop, linux-lowlatency, linux-lowlatency-hwe-5.15, linux-nvidia, linux-oracle vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8297-1 linux-gcp-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8243-1 linux-azure-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8187-1 linux-nvidia-tegra, linux-nvidia-tegra-igx vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8275-1 linux-xilinx-zynqmp vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8180-6 linux-raspi vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8186-1 linux-intel-iot-realtime, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8188-1 linux-hwe-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8180-5 linux-ibm, linux-ibm-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8180-3 linux-azure, linux-intel-iotg, linux-intel-iotg-5.15, linux-kvm, linux-oracle-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8162-1 linux-nvidia-tegra-5.15 vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8180-2 linux-fips, linux-gcp-fips vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8180-4 linux-azure-fips vulnerabilities Ubuntu Security Notices (USN) · Nov 4, 2026
- USN-8029-2 linux-aws, linux-oracle vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8048-1 linux-oem-6.17 vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8029-3 linux-azure vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8030-1 linux-gcp vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8029-1 linux, linux-raspi, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- ALSA-2026:49211 Important: kernel security, bug fix, and enhancement update AlmaLinux Security Advisories · Oct 29, 2026
- ALSA-2026:59723 Important: kernel security, bug fix, and enhancement update AlmaLinux Security Advisories · Oct 29, 2026
- WID-SEC-2026-3623 IBM DataPower Gateway: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 18, 2026
- NCSC-2026-0431 Kwetsbaarheden verholpen in IBM DataPower Gateway en onderliggende componenten NCSC-NL (Netherlands) · Oct 16, 2026
- RHSA-2026:62568 Red Hat Security Advisory: kernel security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Oct 15, 2026
- RHSA-2026:59723 Red Hat Security Advisory: kernel security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Oct 14, 2026
- RHSA-2026:49211 Red Hat Security Advisory: kernel security, bug fix, and enhancement update Red Hat Security Advisories (RHSA) · Oct 7, 2026
- RLSA-2026:59723 Important: kernel security, bug fix, and enhancement update Rocky Linux Security Advisories · Aug 27, 2026
- ELSA-2026-59723 Important: kernel security, bug fix, and enhancement update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Aug 26, 2026
- ELSA-2026-49211 Important: kernel security, bug fix, and enhancement update (Oracle Linux 10) Oracle Linux Security Advisories (ELSA) · Aug 4, 2026
- RLSA-2026:49211 Important: kernel security, bug fix, and enhancement update Rocky Linux Security Advisories · Aug 2, 2026
- SUSE-SU-2026:20570-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Jul 9, 2026
- openSUSE-SU-2026:20287-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20615-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20599-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20555-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- ELSA-2026-50145 Important: Unbreakable Enterprise kernel security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · Mar 10, 2026
- DSA-6127-1 linux - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-4475-1 linux - security update Debian Security (DSA / DLA) · Feb 10, 2026
- DLA-4476-1 linux-6.1 - security update Debian Security (DSA / DLA) · Feb 10, 2026
- ELSA-2026-50006 Important: Unbreakable Enterprise kernel security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Jan 13, 2026
References
- https://git.kernel.org/stable/c/220cb3e425e17587f560335924cba9f16a842c64
- https://git.kernel.org/stable/c/10644e8839544dd5699c03c8fb1aeeefc41602fd
- https://git.kernel.org/stable/c/67137b715b7db28d82e4ed07a7092c2fa6ba7adb
- https://git.kernel.org/stable/c/9c2f8a9b68024e5ebb4813665845ec0a95f2eac3
- https://git.kernel.org/stable/c/74f78421c925b6d17695566f0c5941de57fd44b3
- https://git.kernel.org/stable/c/f62973e0767e4fcd6799087787fca08ca2a85b8c
- https://git.kernel.org/stable/c/f5548c318d6520d4fa3c5ed6003eeb710763cbc5