# /home/anton/tmp/robsd/src-sys-ptrace-revert.diff commit 43cc3f6eb7bf0b7114d5fd4359a87de2d21e3104 Author: Anton Lindqvist Date: Sun Jun 28 06:55:45 2026 +0200 Revert "Always untrace traced children even when they're exiting. But do skip" This reverts commit 452256cb16b977d82c200c63b51c92ba101a3b2e. diff --git sys/kern/kern_exit.c sys/kern/kern_exit.c index 0506127628f3..df04c4270eac 100644 --- sys/kern/kern_exit.c +++ sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.253 2026/06/25 08:14:20 kettenis Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.252 2025/08/10 15:17:57 deraadt Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -317,23 +317,21 @@ exit1(struct proc *p, int xexit, int xsig, int flags) * existence means someone is screwing up. */ mtx_enter(&qr->ps_mtx); - if (qr->ps_flags & PS_TRACED) { + if (qr->ps_flags & PS_TRACED && + !(qr->ps_flags & PS_EXITING)) { process_untrace(qr); mtx_leave(&qr->ps_mtx); - if ((pr->ps_flags & PS_EXITING) == 0) { - /* - * If single threading is - * active, direct the signal - * to the active thread to - * avoid deadlock. - */ - if (qr->ps_single) - ptsignal(qr->ps_single, - SIGKILL, STHREAD); - else - prsignal(qr, SIGKILL); - } + /* + * If single threading is active, + * direct the signal to the active + * thread to avoid deadlock. + */ + if (qr->ps_single) + ptsignal(qr->ps_single, SIGKILL, + STHREAD); + else + prsignal(qr, SIGKILL); } else { process_reparent(qr, initprocess); mtx_leave(&qr->ps_mtx);