CVE-2026-99659: mm/mmu_gather: fix flushing ranges with 4 GiB or larger
In the Linux kernel, the following vulnerability has been resolved:
mm/mmugather: fix flushing ranges with 4 GiB or larger
tlbadjustrange() takes the size of the range which has to be flushed as an unsigned int. Its callers, tlbflush{pte,pmd,pud,p4d}range(), get and pass an unsigned long. Consequently, a range that is 4 GiB or larger gets truncated, possibly to 0.
On arm64 with hugetlb, a 64k kernel can have 16 GiB hugetlb folios mapped contiguously at the PMD level and flush them when unmapping, and a 16k kernel can flush 64 GiB PUDs through tlbunsharepmdptdesc(). So at least these two scenarios are affected.
Fix it by flushing the proper range instead of the truncated one by properly using "unsigned long" for rangesize.
Fix generated by an LLM and sent by Josef Bacik in private.
[ david: use two-tab indent, simplify description ]
Affected Software
Frequently Asked Questions
Which systems are specifically known to be affected by this range-truncation issue?
The described affected cases are arm64 systems using hugetlb. A 64K kernel can encounter it when unmapping contiguous 16 GiB hugetlb folios at the PMD level, and a 16K kernel can encounter it when flushing 64 GiB PUDs through tlb_unshare_pmd_ptdesc().
What condition triggers the faulty behavior?
The issue is triggered when a TLB flush range is 4 GiB or larger. The range size is passed as an unsigned long by callers but handled as an unsigned int, causing truncation that can reduce the flush size, potentially to zero.
What is the effect of the fix?
The fix changes the range-size handling to use unsigned long, matching the callers. This ensures that large flush ranges are flushed at their actual size rather than a truncated value.