ptrace: Return the signal to continue with from ptrace_stop
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 27 Jan 2022 18:19:13 +0000 (12:19 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 18 Mar 2022 14:52:10 +0000 (09:52 -0500)
commit6487d1dab837214ec2fd3f0ddd5f787e63be7c20
treebf234f26e6cc4403f5b53a96fe393251dee84ebb
parent336d4b814bf078fa698488632c19beca47308896
ptrace: Return the signal to continue with from ptrace_stop

The signal a task should continue with after a ptrace stop is
inconsistently read, cleared, and sent.  Solve this by reading and
clearing the signal to be sent in ptrace_stop.

In an ideal world everything except ptrace_signal would share a common
implementation of continuing with the signal, so ptracers could count
on the signal they ask to continue with actually being delivered.  For
now retain bug compatibility and just return with the signal number
the ptracer requested the code continue with.

Link: https://lkml.kernel.org/r/875yoe7qdp.fsf_-_@email.froward.int.ebiederm.org
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
include/linux/ptrace.h
kernel/signal.c