]> git.baikalelectronics.ru Git - kernel.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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 8 Nov 2020 19:18:39 +0000 (11:18 -0800)
commitfa773cd0be09fb81aa6acf512c5c053bb4614a7a
tree72e12c5023507b955eed888011eca19f579a38ed
parent5df45047abfc412f156810e044d8250bbc70edf3
fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent

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>
kernel/fork.c