PT-2026-162887

CVE-2026-99920

·

Published

2026-11-30

·

Updated

2026-11-30

Description by

Score
N/A
Not available

No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.

In the Linux kernel, the following vulnerability has been resolved:
mm/mlock: use a long for the page count in mlock fixup()
mlock fixup() adjusts mm->locked vm, an unsigned long, by the number of pages whose VM LOCKED state it changes, but computes that number in an int:
int nr pages;
...
nr pages = (end - start) >> PAGE SHIFT;
...
mm->locked vm += nr pages;
When a single VMA range of 2^31 pages (8 TiB with 4 KiB pages) or more is locked or unlocked, the count is truncated to 32 bits and then sign-extended, so locked vm is changed by the wrong amount, while munmap(), mremap() and the other paths that maintain locked vm use the full unsigned long page count.
Such a range is reachable on 64-bit architectures with a 47-bit or larger user address space (x86 64, arm64 with 48-bit VA, riscv64 Sv48) by a task with CAP IPC LOCK or a raised RLIMIT MEMLOCK, which do mlock() checks against the full untruncated length. It costs nothing with MAP NORESERVE and MLOCK ONFAULT/MCL ONFAULT, since then no page is populated. On x86 64, after
p = mmap(NULL, 8UL << 40, PROT READ | PROT WRITE,
	 MAP PRIVATE | MAP ANONYMOUS | MAP NORESERVE, -1, 0);
mlock2(p, 8UL << 40, MLOCK ONFAULT);
VmLck in /proc/self/status reads 18446744065119617024 kB instead of 8589934592 kB; munmap() of the region then subtracts the true size and leaves VmLck at 18446744056529682432 kB instead of 0. With 16 TiB, locked vm is not changed at all, VmLck stays 0 kB, and after the task drops CAP IPC LOCK or lowers RLIMIT MEMLOCK, mlock(), mmap(MAP LOCKED) and the other mlock future ok() and account locked vm() users enforce RLIMIT MEMLOCK against that count, so they let the task lock memory beyond its limit (or, in the 8 TiB case, refuse every further lock). The error persists for the life of the mm; unlocking the range in pieces skews it further. The wrong count is per-mm accounting only: it does not change which pages are locked.
The int has been there since before git history (the variable was named "pages" until it was renamed in 2.6.28); every other updater of locked vm uses an unsigned long or long count. Make nr pages a long, which holds the page count of any user range and its negation, so the existing sign handling is unchanged.
Found by formal verification of mm/mlock.c against the kernel binary.
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾