Skip to content

mm/mmap: fix crashes in dup_mmap() error path

Hui Zhu linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/mmap: fix Use-After-Free of vma_iterator in dup_mmap() error pathmm/mmap.c+2 -11 reply
2/2mm/mmap: fix NULL pointer dereference in dup_mmap() error handlingmm/mmap.c+18 -131 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH mm-unstable 0/2] mm/mmap: fix crashes in dup_mmap() error path

From: Hui Zhu <[email protected]>

This series fixes two potential kernel panics in the dup_mmap() error path triggered during fork failures:
Fix Use-After-Free: Moves vma_iter_free() to the end of the cleanup block to ensure the iterator remains valid during rollback. Fix NULL Dereference: Adds a check for vma_next() results to prevent crashing when the maple tree is empty.

Hui Zhu (2):
mm/mmap: fix Use-After-Free of vma_iterator in dup_mmap() error path mm/mmap: fix NULL pointer dereference in dup_mmap() error handling

 mm/mmap.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)
Signature · 1 line
2.43.0