mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
896fc4638a
When truss is detaching from very active process it is possible to hang on waitpid(2) in restore_proc() forever, because ptrace(PT_SYSCALL) must be called before detaching, to allow the debugging process to continue execution. Also when truss called with '-c' argument, it does not print anything after detach, because it immediately exits from restore_proc(). To fix these two problems make detaching deferred, but then it is impossible to detach from a process which does not do any system call. To fix this issue use sigaction(2) instead of signal(3) to disable SA_RESTART flag for waitpid(2) that makes it non-restartable. Remove global variable child_pid, because now detaching is handled in context where child's pid is known. Reported by: mjg Tested by: mjg, swills Approved by: kib (mentor) MFC after: 2 weeks |
||
---|---|---|
.. | ||
amd64-fbsd32.c | ||
amd64-fbsd.c | ||
amd64-linux32.c | ||
amd64linux32.conf | ||
extern.h | ||
fbsd32.conf | ||
i386-fbsd.c | ||
i386-linux.c | ||
i386.conf | ||
i386linux.conf | ||
ia64-fbsd.c | ||
main.c | ||
Makefile | ||
mips-fbsd.c | ||
powerpc64-fbsd.c | ||
powerpc-fbsd.c | ||
setup.c | ||
sparc64-fbsd.c | ||
syscall.h | ||
syscalls.c | ||
truss.1 | ||
truss.h |