| 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 /var/archive3/public/freebsd-releng-10.4-src/sys/kern/kern_sig.c freebsd-10.4/sys/kern/kern_sig.c |
| --- /var/archive3/public/freebsd-releng-10.4-src/sys/kern/kern_sig.c 2017-09-29 08:19:46.000000000 +0800 |
| +++ freebsd-10.4/sys/kern/kern_sig.c 2019-08-20 09:26:37.517072524 +0800 |
| @@ -2826,9 +2826,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 |