Commit 606c812
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: 763ecb0 ("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>1 parent 1b29d27 commit 606c812
1 file changed
Lines changed: 17 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2318 | 2318 | | |
2319 | 2319 | | |
2320 | 2320 | | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
2324 | | - | |
2325 | | - | |
2326 | | - | |
2327 | | - | |
2328 | | - | |
2329 | | - | |
2330 | | - | |
2331 | | - | |
2332 | | - | |
2333 | | - | |
2334 | | - | |
2335 | | - | |
2336 | 2321 | | |
2337 | 2322 | | |
2338 | 2323 | | |
| |||
2354 | 2339 | | |
2355 | 2340 | | |
2356 | 2341 | | |
| 2342 | + | |
2357 | 2343 | | |
2358 | 2344 | | |
2359 | 2345 | | |
| |||
2399 | 2385 | | |
2400 | 2386 | | |
2401 | 2387 | | |
2402 | | - | |
2403 | | - | |
2404 | | - | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
2405 | 2395 | | |
2406 | 2396 | | |
2407 | 2397 | | |
| |||
2447 | 2437 | | |
2448 | 2438 | | |
2449 | 2439 | | |
| 2440 | + | |
2450 | 2441 | | |
2451 | 2442 | | |
2452 | | - | |
| 2443 | + | |
2453 | 2444 | | |
| 2445 | + | |
2454 | 2446 | | |
2455 | 2447 | | |
2456 | 2448 | | |
| |||
2480 | 2472 | | |
2481 | 2473 | | |
2482 | 2474 | | |
| 2475 | + | |
2483 | 2476 | | |
2484 | | - | |
| 2477 | + | |
2485 | 2478 | | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
2486 | 2483 | | |
2487 | 2484 | | |
2488 | 2485 | | |
| |||
0 commit comments