mm/hugetlb: preserve mremap address delta when skipping page tables
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e95a9851787bbb3cd4deb40fe8bab03f731852d1 · < 9bdad082d44bdcf93716973dcba6be77e8a06e7b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mm/hugetlb: preserve mremap address delta when skipping page tables
move_hugetlb_page_tables() optimizes mremap() by advancing to the last entry in the page table when the source page table does not exist, either initially or after unsharing a PMD table. The common loop increment then steps to the first entry in the next page table.
However, the code advances both the source and destination addresses to the last entries in their respective page tables, which is wrong. The destination address must be advanced only by the same amount as the source address.
If the source and destination offsets within their page tables differ, the destination address can be advanced too far, causing follow-up issues. Fix this by advancing the destination address by the source advance distance.
With a reproducer, we were able to trigger a kernel panic on x86-64. With this fix in place, we can no longer reproduce the issue.
From the CVE record · Linux
The Linux kernel's hugetlb mremap() code can advance a destination address too far when source and destination offsets within their page tables differ. A reproducer triggered a kernel panic on x86-64; the input does not establish authentication requirements or whether user interaction is needed.
Engineers running Linux kernels with the affected hugetlb remapping code should check their kernel version; affected versions are not specified.