]> git.baikalelectronics.ru Git - kernel.git/commit
signal: In get_signal test for signal_group_exit every time through the loop
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 15 Nov 2021 17:55:57 +0000 (11:55 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 17 Nov 2021 16:30:28 +0000 (10:30 -0600)
commitd5b67df19af44a36c79adcc1c268e8d86e1476d7
tree47003d63b966b2d66a7a13b16651ac74be80e7c2
parentbad68f6c0c96b209be688acd1511fc590315093b
signal: In get_signal test for signal_group_exit every time through the loop

Recently while investigating a problem with rr and signals I noticed
that siglock is dropped in ptrace_signal and get_signal does not jump
to relock.

Looking farther to see if the problem is anywhere else I see that
do_signal_stop also returns if signal_group_exit is true.  I believe
that test can now never be true, but it is a bit hard to trace
through and be certain.

Testing signal_group_exit is not expensive, so move the test for
signal_group_exit into the for loop inside of get_signal to ensure
the test is never skipped improperly.

This has been a potential problem since I added the test for
signal_group_exit was added.

Fixes: a9984939d9dd ("signal: Always notice exiting tasks")
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/875yssekcd.fsf_-_@email.froward.int.ebiederm.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
kernel/signal.c