diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-03-22 16:39:12 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-04-12 01:42:00 +0200 |
commit | 66ae0d1e2d9fe6ec70e73fcfdcf4b390e271c1ac (patch) | |
tree | 57eeb40323814b8d43230e3c27e9dc60256dd0a0 /kernel | |
parent | io_uring: allow events and user_data update of running poll requests (diff) | |
download | linux-66ae0d1e2d9fe6ec70e73fcfdcf4b390e271c1ac.tar.xz linux-66ae0d1e2d9fe6ec70e73fcfdcf4b390e271c1ac.zip |
kernel: allow fork with TIF_NOTIFY_SIGNAL pending
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().
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 426cd0c51f9e..b81ccb1ca3a7 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1941,7 +1941,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; |