mm/vmalloc: acquire init_mm lock on huge vmap to avoid ptdump UAF
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b6bdb7517c3d3f41f20e5c2948d6bc3f8897394e · < c5bf8cd148cfea948cfa3db71da427294b20db0f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mm/vmalloc: acquire init_mm lock on huge vmap to avoid ptdump UAF
Patch series "mm: fix UAF caused by race between ptdump and vmap pgtable freeing", v6.
Kernel page table walkers fall into two broad categories - those ranges where no exclusion is required via walk_kernel_page_table_range_lockless() and those where exclusion is required via walk_kernel_page_table_range() or walk_page_range_debug().
The former category is used only by arm64 arch code operating on ranges it both wholly owns and does not concurrently write.
The latter category consists of kernel page table walkers operating on ranges that are wholly owned (but which need exclusion against concurrent writers).
The lock used for exclusion is the mmap lock, and for kernel ranges this is the mmap lock on init_mm.
ptdump is a special case being both the only user of walk_page_range_debug(), and the only case in which it walks ranges it does not own.
From the CVE record · Linux
The Linux kernel can experience a use-after-free when ptdump walks page tables while huge vmap promotion frees a lower page table. This requires the operations to occur concurrently. The input does not specify how an attacker could trigger the race or whether authentication or user interaction is required.
Teams running the Linux kernel should check their deployments; affected versions are not specified.