Linux: mm/hugetlb: preserve mremap address delta when skipping page tables
What fixes it
- 7a96b0f657c8d799ea5b8e02fc9ec7cca0e6e7ffLinuxCVE List
- 850cc4a84b36a0062dcd0391acd2450e20ab0767LinuxCVE List
- 480a39b0a12c977ed6e755f3d12a23424c57d11fLinuxCVE List
- 9bdad082d44bdcf93716973dcba6be77e8a06e7bLinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
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.
Text from CVE List
Affected versions 12
- Linuxaffected: e95a9851787bbb3cd4deb40fe8bab03f731852d1 before cf73ef2a761df9329af116c905a7a94b317921e4CVE List
- Linuxaffected: e95a9851787bbb3cd4deb40fe8bab03f731852d1 before 7a96b0f657c8d799ea5b8e02fc9ec7cca0e6e7ffCVE List
- Linuxaffected: e95a9851787bbb3cd4deb40fe8bab03f731852d1 before 850cc4a84b36a0062dcd0391acd2450e20ab0767CVE List
- Linuxaffected: e95a9851787bbb3cd4deb40fe8bab03f731852d1 before 480a39b0a12c977ed6e755f3d12a23424c57d11fCVE List
- Linuxaffected: e95a9851787bbb3cd4deb40fe8bab03f731852d1 before 9bdad082d44bdcf93716973dcba6be77e8a06e7bCVE List
- Linuxaffected: 6.0CVE List
- Linuxunaffected: all versions before 6.0CVE List
- Linuxunaffected: 6.6.160 through 6.6.*CVE List
- Linuxunaffected: 6.12.112 through 6.12.*CVE List
- Linuxunaffected: 6.18.55 through 6.18.*CVE List
- Linuxunaffected: 7.2.9 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/cf73ef2a761df9329af116c905a7a94b317921e4Referencevia CVE List
- git.kernel.org/stable/c/7a96b0f657c8d799ea5b8e02fc9ec7cca0e6e7ffReferencevia CVE List
- git.kernel.org/stable/c/850cc4a84b36a0062dcd0391acd2450e20ab0767Referencevia CVE List
- git.kernel.org/stable/c/480a39b0a12c977ed6e755f3d12a23424c57d11fReferencevia CVE List
- git.kernel.org/stable/c/9bdad082d44bdcf93716973dcba6be77e8a06e7bReferencevia CVE List