userfaultfd: don't BUG_ON() if khugepaged yanks our page table
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.6.516.10.106.11In the Linux kernel, the following vulnerability has been resolved:
userfaultfd: don't BUG_ON() if khugepaged yanks our page table
Since khugepaged was changed to allow retracting page tables in file mappings without holding the mmap lock, these BUG_ON()s are wrong - get rid of them.
We could also remove the preceding "if (unlikely(...))" block, but then we could reach pte_offset_map_lock() with transhuge pages not just for file mappings but also for anonymous mappings - which would probably be fine but I think is not necessarily expected.
From the CVE record · Linux
The Linux kernel's userfaultfd code can hit an incorrect BUG_ON() when khugepaged retracts a page table in a file mapping. This can crash the kernel under that condition; the input does not establish authentication requirements or whether an attacker needs local access or user interaction.
Engineers running Linux kernels with userfaultfd and khugepaged should check their versions; affected versions are not specified.