arm64: mm: Fix the lockless page-table walk in show_pte()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1d18c47c735e8adfe531fc41fae31e98f86b68fe · < 68cbd70795dd8c06e7ccdc4eb0b74c5b180076c3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
arm64: mm: Fix the lockless page-table walk in show_pte()
show_pte() walks page tables locklessly and can run with interrupts enabled. A concurrent teardown can free a table page while it is being walked. It can also clear a parent entry after show_pte() checked it; the regular pXd_offset() helpers then reread the cleared entry and can derive a bogus lower-level pointer and fault again.
Use the lockless offset helpers with the saved parent entries, as gup_fast() does, and pass the saved PMD to pte_offset_map().
For task page tables, arm64 selects MMU_GATHER_RCU_TABLE_FREE. Disable local interrupts around the walk to hold off RCU-deferred table frees and block the tlb_remove_table_sync_one() IPI until the walk is finished.
Place the IRQ guard after the header print. This does not make the output a consistent snapshot, but prevents the task page-table walk from dereferencing a released table page or deriving a pointer from a different parent value.
From the CVE record · Linux
The arm64 show_pte() function walks page tables without a lock. If a page table is torn down concurrently, the walk can access a freed table page or derive an invalid pointer and fault. The input does not specify how an attacker could trigger this or whether access or user interaction is required.
Engineers running Linux kernels on arm64 should check their versions; no affected versions are specified.