If a memory allocation fails during dup_mmap(), the maple tree can be left in an unsafe state for other iterators besides the exit path. All the locks are dropped before the exit_mmap() call (in mm/mmap.c), but the incomplete mm_struct can be reached through (at least) the rmap finding the vmas which have a pointer back to the mm_struct. Up to this point, there have been no issues with being able to find an mm_struct that was only partially initialised. Syzbot was able to make the incomplete mm_struct fail with recent forking changes, so it has been proven unsafe to use the mm_struct that hasn't been initialised, as referenced in the link below. Although |
||
|---|---|---|
| .. | ||
| Makefile | ||
| callchain.c | ||
| core.c | ||
| hw_breakpoint.c | ||
| hw_breakpoint_test.c | ||
| internal.h | ||
| ring_buffer.c | ||
| uprobes.c | ||