x86/mm/pat: Acquire init_mm write lock on collapse to avoid UAF
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.537.2.77.3In the Linux kernel, the following vulnerability has been resolved:
x86/mm/pat: Acquire init_mm write lock on collapse to avoid UAF
x86 implements page attribute modification using its Change Page Attributes (CPA) mechanism.
This tracks properties of ranges such as cache mode through x86 page attributes, and as part of that logic manipulates kernel page tables.
Since commit:
41d88484c71c ("x86/mm/pat: restore large ROX pages after fragmentation")
ranges of kernel page table entries can be collapsed into huge page table entries as part of this logic.
As part of this collapse, it frees the page tables which the collapsed entries previously pointed to, and it does so without any relevant locks being held to preclude concurrent kernel page table walkers.
From the CVE record · Linux
The Linux kernel’s x86 page-attribute code can free page tables during a collapse without holding a lock that excludes concurrent walkers. A concurrent ptdump walk can encounter a use-after-free, and concurrent collapse operations can also race. The input does not establish an attacker entry point, authentication requirement, or user-interaction requirement.
Engineers running Linux kernels with the affected x86/mm/pat code should check their kernel versions; no affected version range is provided.