CVE-2026-74674: mm: fix incorrect flush address in direct page table reclaim

Published Aug 22, 2026
·
Updated

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

mm: fix incorrect flush address in direct page table reclaim

When zappterange reclaims a page table, it does:

ptefreetlb(tlb, pmdpgtable(pmdval), addr);

and this is unconditionally wrong: if this code executes, addr always points one past the end of the range covered by the table. The addr parameter is used to flush the TLB (really the paging-structure-cache) to drop references to the to-be-freed table, and any architecture that cares about the parameter will flush the wrong address. (But they'll still free the correct page).

I think it's worth contemplating why the kernel works at all.

If we hit the offending line of code, we will first clear the PMD entry (line 1954, zapemptyptetable), then we will issue pending flushes if forceflush is set (tlbflushmmutlbonly(tlb)), then we will skip the retry on line 1979 (phew!), and then we will do the offending ptefreetlb call. Or we will clear the PMD entry immediately before ptefreetlb (line 1983, zapptetableifempty).

If we have any pending flushes (i.e. we actually zapped any last-level entries) at the time we clear the PMD entry, then the flush really ought to flush all references to the table (Linus certainly seems to think it will on all architectures [0]).

The condition under which we have no accumulated flushes at the time of the clear is very complex (the whole zappterange function has absurdly complex control flow). If we do hit the bad case, then we will end up clearing the PMD entry after the last time the range is flushed, and any CPU is free to cache a reference to the (empty) page table. If this happens due to an ordinary read or write, it would segfault, so it would be rare. But the cache could be speculatively filled as well. Then we'll flush the wrong address and then free and possibly reuse the table.

On x86, even flushing the wrong address works on non-KPTI Intel systems because INVLPG flushes all paging-structure-caches, not just the ones for the target address. But INVPCID does not, and flushtlboneuser will use INVPCID if it's available. And then we're toast. AMD systems are more susceptible: we set the EFER.TCE bit, which makes even INVLPG only flush the target address.

I think this might fix an issue in ripgrep reported here: https://github.com/BurntSushi/ripgrep/issues/3494

[0] https://lore.kernel.org/all/CA+55aFzBggoXtNXQeng5dmRoDnaMBE5Y+URs+PHR67nUpMtaw@mail.gmail.com/T/#u

Affected Software

1 affected component
Linux Kernel

Event History

Aug 22, 2026
CVE Published
via MITRE·03:32 PM
Data Sourced
via MITRE·03:32 PM
Description

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