hugetlb: only adjust reservation during unmapping if mapcount is 0
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:
hugetlb: only adjust reservation during unmapping if mapcount is 0
Since df7a6d1f6405, __unmap_hugepage_range can adjust reservations. In the case of folio mapped in both a parent and a child, if the parent unmaps the range first, the reservation adjustment will result in an underflow of the reserved count. Once the child unmaps the range, the count is restored. Change __unmap_hugepage_range() to check the mapcount before adjusting the reservation.
From the CVE record · Linux
The Linux kernel’s hugetlb unmapping code can underflow the reserved count when a huge-page folio is mapped in both a parent and child and the parent unmaps first. The count is restored when the child unmaps; the input does not specify an attacker action, access requirement, or user interaction.
Operators running Linux kernels containing the affected hugetlb code should check their versions; no affected version range is provided.