CVE-2026-74599: mm/ptdump: always stabilise against page table freeing using init_mm
In the Linux kernel, the following vulnerability has been resolved:
mm/ptdump: always stabilise against page table freeing using initmm
Previous commits have established the invariant that kernel page table freeing is performed while an mmap read lock on initmm is held, which fixes races between ptdump and kernel page table freeing over initmm.
However, x86 and arm64 can perform a ptdump over an mm other than initmm via ptdumpwalkpgd() and since kernel memory ranges are shared across non-kernel mm's, this means that the race still exists for these cases.
Fix this by acquiring a nested mmap write lock for initmm in ptdumpwalkpgd().
This is safe as we take this after mmap write locking the mm, and nothing acquires the initmm lock first before locking an arbitrary mm, so no deadlock is possible.
Also update walkpagerangedebug() to assert that initmm is write locked, add a comment explaining why and remove some redundant code, and eliminate the unnecessary and confusing invocation of walkkernelpagetablerange().
We can safely remove the non-NULL check for walk.mm, as the mmap lock asserts would NULL pointer deref if it was (and of course no callers do this).
The first point at which ptdump can race kernel page table freeing is commit b6bdb7517c3d ("mm/vmalloc: add interfaces to free unmapped page table"), so we target this in the Fixes tag.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel mm/ptdumpto a version that resolves this vulnerability.Patch b6bdb7517c3d - Configuration
Update walk_page_range_debug() to assert that init_mm is write, and fix the ptdump race by acquiring a nested mmap write lock for init_mm before stabilizing page table traversal.
Linux kernel mm/ptdump walk_page_range_debug() assert on init_mm = assert init_mm is write - Configuration
Remove the non-NULL check for walk.mm since the mmap lock acquires the init_mm lock first before locking an arbitrary mm, preventing NULL-pointer dereferences.
Linux kernel mm/ptdump walk_page_range_debug() walk.mm non-NULL check = remove non-NULL check