linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mm-unstable 0/2] mm/mmap: fix crashes in dup_mmap() error path
@ 2026-03-04  7:00 Hui Zhu
  2026-03-04  7:00 ` [PATCH mm-unstable 1/2] mm/mmap: fix Use-After-Free of vma_iterator " Hui Zhu
  2026-03-04  7:00 ` [PATCH mm-unstable 2/2] mm/mmap: fix NULL pointer dereference in dup_mmap() error handling Hui Zhu
  0 siblings, 2 replies; 3+ messages in thread
From: Hui Zhu @ 2026-03-04  7:00 UTC (permalink / raw)
  To: Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	Vlastimil Babka, Jann Horn, Pedro Falcato, linux-mm,
	linux-kernel
  Cc: Hui Zhu

From: Hui Zhu <zhuhui@kylinos.cn>

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(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-04  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-04  7:00 [PATCH mm-unstable 0/2] mm/mmap: fix crashes in dup_mmap() error path Hui Zhu
2026-03-04  7:00 ` [PATCH mm-unstable 1/2] mm/mmap: fix Use-After-Free of vma_iterator " Hui Zhu
2026-03-04  7:00 ` [PATCH mm-unstable 2/2] mm/mmap: fix NULL pointer dereference in dup_mmap() error handling Hui Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox