CVE-2026-99914: mm/mremap: populate calculated fields in vrm state correctly
In the Linux kernel, the following vulnerability has been resolved:
mm/mremap: populate calculated fields in vrm state correctly
Commit d5c8aec0542e ("mm/mremap: initial refactor of movevma()") introduced the vmaremapstruct helper to pass state sanely through mremap() logic.
Part of this state is vrm->delta - equal to the absolute difference between vrm->oldlen and vrm->newlen (the old and new lengths of the VMA, respectively).
This value is used to correctly charge accounted VMAs.
When shrinking a VMA, mremapto() sets vrm->oldlen equal to vrm->newlen having performed the shrink of the VMA first, prior to any potential move (e.g. MREMAPFIXED | MREMAPMAYMOVE specified).
However it does not recalculate vrm->delta, which results in incorrectly overcharging the VMA when both moving and shrinking a VMA.
The charge leaks to CommittedAS globally, meaning a mischievous user can cause allocations to fail across the system in strict overcommit mode.
Resolve the issue by abstracting the update of vrm->delta to vrmpopulatecalculated() and invoking this from mremapto() when vrm->oldlen is changed.
Additionally, update vrm->remaptype whose value depends on vrm->delta. The field is not read again after the shrink, but it is the logically correct thing to do and protects against future changes which break this.