CVE-2025-68211: ksm: use range-walk function to jump over holes in scan_get_next_rmap_item

Published Dec 16, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

ksm: use range-walk function to jump over holes in scangetnextrmapitem

Currently, scangetnextrmapitem() 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 walkpagerange(). 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 sizet size = 32ul 1024 1024 1024 1024;

int main() { char area = mmap(NULL, size, PROTREAD | PROTWRITE, MAPNORESERVE | MAPPRIVATE | MAPANON, -1, 0);

if (area == MAPFAILED) { perror("mmap() failed\n"); return -1; }

/ Populate a single page such that we get an anonvma. / area = 0;

/ Enable KSM. / madvise(area, size, MADVMERGEABLE); 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 Software

15 affected componentsFixes available
The Linux Foundation Linux Kernel
Microsoft azl3 kernel 6.6.117.1-1
Linux Linux kernel>=2.6.32<5.10.249
Linux Linux kernel>=5.11<5.15.199
Linux Linux kernel>=5.16<6.1.161
Linux Linux kernel>=6.2<6.6.121
Linux Linux kernel>=6.7<6.12.59
Linux Linux kernel>=6.13<6.17.9
Linux Linux kernel=6.18-rc1
Linux Linux kernel=6.18-rc2
Linux Linux kernel=6.18-rc3
Linux Linux kernel=6.18-rc4
Linux Linux kernel=6.18-rc5
Microsoft azl3 kernel 6.6.119.3-3
Microsoft cbl2 kernel 5.15.186.1-1

Event History

Dec 16, 2025
CVE Published
via MITRE·01:48 PM
Data Sourced
via MITRE·01:48 PM
Description
Data Sourced
via Red Hat·02:04 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·02:15 PM
RemedyDescriptionSeverityAffected Software
Dec 17, 2025
Data Sourced
via Microsoft·01:01 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·09:01 AM
Affected Software
Updated
via Microsoft·09:01 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2025-68211?

CVE-2025-68211 has been classified with a medium severity rating due to its impact on system performance.

2

How do I fix CVE-2025-68211?

To resolve CVE-2025-68211, update your Linux kernel to the latest patched version provided by your distribution.

3

Which versions of the Linux kernel are affected by CVE-2025-68211?

CVE-2025-68211 affects specific versions of the Linux kernel before the fix was applied in the stable releases.

4

What type of vulnerability is CVE-2025-68211?

CVE-2025-68211 is a performance-related vulnerability that affects the kernel's memory management routines.

5

Is CVE-2025-68211 actively exploited?

As of now, there is no indication that CVE-2025-68211 is being actively exploited in the wild.

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