• Eric W. Biederman's avatar
    signal: Restore the stop PTRACE_EVENT_EXIT · 492647b2
    Eric W. Biederman authored
    commit cf43a757fd49442bc38f76088b70c2299eed2c2f upstream.
    
    In the middle of do_exit() there is there is a call
    "ptrace_event(PTRACE_EVENT_EXIT, code);" That call places the process
    in TACKED_TRACED aka "(TASK_WAKEKILL | __TASK_TRACED)" and waits for
    for the debugger to release the task or SIGKILL to be delivered.
    
    Skipping past dequeue_signal when we know a fatal signal has already
    been delivered resulted in SIGKILL remaining pending and
    TIF_SIGPENDING remaining set.  This in turn caused the
    scheduler to not sleep in PTACE_EVENT_EXIT as it figured
    a fatal signal was pending.  This also caused ptrace_freeze_traced
    in ptrace_check_attach to fail because it left a per thread
    SIGKILL pending which is what fatal_signal_pending tests for.
    
    This difference in signal state caused strace to report
    strace: Exit of unknown pid NNNNN ignored
    
    Therefore update the signal handling state like dequeue_signal
    would when removing a per thread SIGKILL, by removing SIGKILL
    from the per thread signal mask and clearing TIF_SIGPENDING.
    Acked-by: 's avatarOleg Nesterov <oleg@redhat.com>
    Reported-by: 's avatarOleg Nesterov <oleg@redhat.com>
    Reported-by: 's avatarIvan Delalande <colona@arista.com>
    Cc: stable@vger.kernel.org
    Fixes: 35634ffa1751 ("signal: Always notice exiting tasks")
    Signed-off-by: 's avatar"Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    492647b2
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...