mm/hugetlb: fix PTE marker handling in hugetlb_change_protection()
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mm/hugetlb: fix PTE marker handling in hugetlb_change_protection()
Patch series "mm/hugetlb: uffd-wp fixes for hugetlb_change_protection()".
Playing with virtio-mem and background snapshots (using uffd-wp) on hugetlb in QEMU, I managed to trigger a VM_BUG_ON(). Looking into the details, hugetlb_change_protection() seems to not handle uffd-wp correctly in all cases.
Patch #1 fixes my test case. I don't have reproducers for patch #2, as it requires running into migration entries.
I did not yet check in detail yet if !hugetlb code requires similar care.
This patch (of 2):
There are two problematic cases when stumbling over a PTE marker in hugetlb_change_protection():
From the CVE record · Linux
The Linux kernel can mishandle userfaultfd write-protection PTE markers in hugetlb_change_protection(). A local process using huge-page-backed memory and userfaultfd write protection can trigger a kernel BUG by protecting a marker again or unprotecting it, then punching a hole in the file range. The input does not specify authentication requirements beyond the ability to perform those operations.
Operators running Linux kernels that use huge pages with userfaultfd write protection should check their kernel version against the vendor advisory; affected versions are not specified here.