Commit d8a11577 authored by Jens Axboe's avatar Jens Axboe Committed by sanglipeng
Browse files

kernel: allow fork with TIF_NOTIFY_SIGNAL pending

stable inclusion
from stable-v5.10.162
commit 0f735cf52bd0b2aaca865e3d2e3dc276479e41ba
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7P7OH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0f735cf52bd0b2aaca865e3d2e3dc276479e41ba



--------------------------------

[ Upstream commit 66ae0d1e ]

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: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 7839e7b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment