]> granicus.if.org Git - strace/commit
Improve handling of unexpected tracees
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 4 Aug 2017 09:33:04 +0000 (11:33 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 5 Aug 2017 21:26:35 +0000 (21:26 +0000)
commit1b93f4032a246e0aa43c2f424921e0aace57b994
treef63b45204ce6b6e245111f215cc13694634a1c2c
parent17f095a9457c4a03faefddcf90e67ba5792e09af
Improve handling of unexpected tracees

When receiving a ptrace stop of an unexpected child, handle it
in the most transparent way possible:
- detach it instead of PTRACE_CONT'ing;
- send it the signal with which it has been stopped.
This should hopefully help to deal with processes that have been created
with misused CLONE_PTRACE flag set.

* strace.c (maybe_allocate_tcb) <WIFSTOPPED(status) && !followfork>:
Calculate the signal similarly to the way next_event does,
forward it to the unexpected tracee, and detach the tracee.
strace.c