CVE-2026-142847: mm/page_isolation: fix UBSAN shift-out-of-bounds warning
In the Linux kernel, the following vulnerability has been resolved:
mm/pageisolation: fix UBSAN shift-out-of-bounds warning
Patch series "mm/pageisolation: fix UBSAN shift-out-of-bounds in isolatesinglepageblock", v3.
Patch 1 fixes a UBSAN shift-out-of-bounds warning in the PageBuddy branch of isolatesinglepageblock() triggered by concurrent buddy allocation.
Patch 2 addresses the same class of issue in the PageCompound branch, where racy compoundorder() and compoundhead() reads could lead to out-of-range shifts or incorrect page skipping.
This patch (of 2):
A contig-range allocation racing with buddy allocation on the adjacent pageblock can trigger:
UBSAN: shift-out-of-bounds in mm/pageisolation.c:393:15 shift exponent -749042176 is negative Call trace: isolatesinglepageblock startisolatepagerange alloccontigfrozenrangenoprof alloccontigrangenoprof
isolatesinglepageblock() first calls setmigratetypeisolate() with zone->lock held, which marks the pageblock MIGRATEISOLATE and moves any free page straddling the boundary out of the way. Once the lock is dropped, it scans the MAXORDERNRPAGES-aligned window [startpfn, boundarypfn) locklessly, only to skip the free pages already handled above and to detect in-use pages straddling the boundary. Since this scan only reads page state to decide how far to skip and returns -EBUSY on a straddling in-use page, it does not take the lock.
The window also covers the adjacent pageblock, whose free pages stay on the normal movable/CMA freelist and can be allocated concurrently. So after the scan observes PageBuddy(page), another CPU can allocate the page, leaving a stale value in page->private that makes "1 << order" shift out of range.
Use buddyorderunsafe() with READONCE to read the order, and validate it is within MAXPAGEORDER before shifting to prevent UBSAN warnings.
Since pageblockisolateandmovefreepages() already handles free pages straddling boundarypfn under zone->lock, bail out with -EBUSY instead of VMWARNONONCE() when a PageBuddy page appears to cross the boundary during the lockless scan.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4
Event History
Frequently Asked Questions
What runtime conditions trigger the issue?
The reported warning can occur when a contiguous-range allocation races with buddy allocation on an adjacent pageblock. The related PageCompound case involves racy compound_order() and compound_head() reads during lockless scanning.
What evidence would indicate that this path has been hit?
A UBSAN shift-out-of-bounds warning in mm/page_isolation.c, potentially reporting a negative shift exponent, indicates the PageBuddy case. The affected call path includes isolate_single_pageblock(), start_isolate_page_range(), and alloc_contig_range_noprof().
What can go wrong beyond the UBSAN warning?
In the PageCompound branch, racy reads can produce out-of-range shifts or cause pages to be skipped incorrectly. The provided information does not describe a workaround other than applying the resolving patches.