| Enable default signal actions be taken on init(8), if it is been ptrace(2)-attached. |
| |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/kern/kern_sig.c freebsd-11.1/sys/kern/kern_sig.c |
| --- /usr/src/sys/kern/kern_sig.c 2017-07-21 07:41:54.000000000 +0800 |
| +++ freebsd-11.1/sys/kern/kern_sig.c 2020-01-26 13:39:39.195238000 +0800 |
| @@ -2889,9 +2889,10 @@ |
| |
| case (intptr_t)SIG_DFL: |
| /* |
| - * Don't take default actions on system processes. |
| + * Don't take default actions on init(8) and system processes. |
| */ |
| - if (p->p_pid <= 1) { |
| + if ((p == initproc && !(p->p_flag & P_TRACED)) || |
| + (p->p_flag & P_SYSTEM)) { |
| #ifdef DIAGNOSTIC |
| /* |
| * Are you sure you want to ignore SIGSEGV |