]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent
authorEddy Wu <itseddy0402@gmail.com>
Sat, 7 Nov 2020 06:47:22 +0000 (14:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 11:39:08 +0000 (12:39 +0100)
commit362dfa5e0205a5ea70bf3ac2ae00487e1a5bb8f5
tree1604be9e922d2d087c78a238782bd5ef3ea7b74c
parentdb495aa9fb84c083333d48ab8e560274f504f0fc
fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent

commit b4e00444cab4c3f3fec876dc0cccc8cbb0d1a948 upstream.

current->group_leader->exit_signal may change during copy_process() if
current->real_parent exits.

Move the assignment inside tasklist_lock to avoid the race.

Signed-off-by: Eddy Wu <eddy_wu@trendmicro.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/fork.c