]> git.baikalelectronics.ru Git - kernel.git/commit
signal: Requeue signals in the appropriate queue
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 15 Nov 2021 19:47:13 +0000 (13:47 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 17 Nov 2021 16:39:12 +0000 (10:39 -0600)
commitf4a8f3c078d6d44cae4dc52823650ad72fe5ebb8
treee875cf8c82219bc4bb0aeecca2d461c509251fc9
parentd5b67df19af44a36c79adcc1c268e8d86e1476d7
signal: Requeue signals in the appropriate queue

In the event that a tracer changes which signal needs to be delivered
and that signal is currently blocked then the signal needs to be
requeued for later delivery.

With the advent of CLONE_THREAD the kernel has 2 signal queues per
task.  The per process queue and the per task queue.  Update the code
so that if the signal is removed from the per process queue it is
requeued on the per process queue.  This is necessary to make it
appear the signal was never dequeued.

The rr debugger reasonably believes that the state of the process from
the last ptrace_stop it observed until PTRACE_EVENT_EXIT can be recreated
by simply letting a process run.  If a SIGKILL interrupts a ptrace_stop
this is not true today.

So return signals to their original queue in ptrace_signal so that
signals that are not delivered appear like they were never dequeued.

Fixes: 794aa320b79d ("[PATCH] sigfix-2.5.40-D6")
History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.gi
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/87zgq4d5r4.fsf_-_@email.froward.int.ebiederm.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/signalfd.c
include/linux/sched/signal.h
kernel/signal.c