> vfork: wake up the parent once the child has left the mm TL;DR: Commit message only: it cites "[1]" for the 2.5.56 change but has no matching link; the review asks for the history.git URL to be added.
> vfork: wake up the parent once the child has left the mm > > A task that called vfork() sleeps until the child has released the mm in > mm_release(). But exec_mmap() releases the old mm, then waits for > exec_update_lock and only then switches to the new mm. And exit_mm() > releases the mm and only then drops it. So the parent is woken up while > the child is still on its mm. > > It wasn't meant to be that way. When mm_release() was added in 2.2 it > was called after the task had been switched away from the mm. exec only > moved it in front of the switch in 2.5.56 because deactivate_mm() and > the write to the child tid address need the old mm (cf. [1]). > > The release has to stay where it is as it can sleep in a page fault for > as long as userspace likes. So take the wakeup out of mm_release(). Wake > up the parent in exec_mmap() once the task has switched to its new mm > and in exit_mm() once it has dropped the mm. > > While at it, fix the comment above mm_release(). It hasn't been called > after the mm was removed from the task since 2.5.56. > > Signed-off-by: Christian Brauner (Amutable) <[email protected]> This isn't a bug, but the changelog cites "(cf. [1])" for the 2.5.56 change that moved mm_release() in front of the mm switch, and there is no "[1]: https://..." line or Link: tag anywhere in the message. The previous commit in the series, d0c33c04297e ("exit: don't take the mmap lock in exit_mm()"), uses the same "(cf. [1])" form and does end with a "[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/..." line. Could the history.git link for the 2.5.56 change be added here as well? --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45508356147
