You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
UPSTREAM: kernel: allow fork with TIF_NOTIFY_SIGNAL pending
[ Upstream commit66ae0d1e2d] fork() fails if signal_pending() is true, but there are two conditions that can lead to that: 1) An actual signal is pending. We want fork to fail for that one, like we always have. 2) TIF_NOTIFY_SIGNAL is pending, because the task has pending task_work. We don't need to make it fail for that case. Allow fork() to proceed if just task_work is pending, by changing the signal_pending() check to task_sigpending(). Change-Id: Iec007746b42f5d62581a8b5f6cca4006e707b8e3 Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit0f735cf52b) Bug: 268174392 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b25b8c55ba
commit
6e4362caf9
@@ -1988,7 +1988,7 @@ static __latent_entropy struct task_struct *copy_process(
|
||||
recalc_sigpending();
|
||||
spin_unlock_irq(¤t->sighand->siglock);
|
||||
retval = -ERESTARTNOINTR;
|
||||
if (signal_pending(current))
|
||||
if (task_sigpending(current))
|
||||
goto fork_out;
|
||||
|
||||
retval = -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user