Liam R. Howlett 606c812eb1 mm/mmap: Fix error path in do_vmi_align_munmap()
The error unrolling was leaving the VMAs detached in many cases and
leaving the locked_vm statistic altered, and skipping the unrolling
entirely in the case of the vma tree write failing.

Fix the error path by re-attaching the detached VMAs and adding the
necessary goto for the failed vma tree write, and fix the locked_vm
statistic by only updating after the vma tree write succeeds.

Fixes: 763ecb035029 ("mm: remove the vma linked list")
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-06-18 09:32:17 -07:00
..
2023-05-06 10:33:38 -07:00
2023-01-18 17:12:57 -08:00
2023-04-30 13:00:38 -07:00
2023-04-12 17:36:23 -07:00
2023-04-18 16:29:42 -07:00
2022-10-03 14:02:43 -07:00
2022-09-26 19:46:09 -07:00
2021-05-07 00:26:35 -07:00
2023-04-12 17:36:23 -07:00
2023-04-08 13:45:37 -07:00
2023-04-05 20:03:01 -07:00
2023-01-18 17:12:57 -08:00
2022-12-11 18:12:10 -08:00