Author: brooks
Date: Wed Sep  9 23:11:55 2020
New Revision: 365545
URL: https://svnweb.freebsd.org/changeset/base/365545

Log:
  MFC r365284:
  
  Always report ENOSYS in init
  
  While rare, encountering an unimplemented system call early in init is
  catastrophic and difficult to debug.  Even after a SIGSYS handler is
  registered, such configurations are problematic.  As such, always report
  such events for pid 1 (following kern.lognosys if non-zero).
  
  Reviewed by:  kevans, imp
  Obtained from:        CheriBSD (plus suggestions from kevans)
  Sponsored by: DARPA
  Differential Revision:        https://reviews.freebsd.org/D26288

Modified:
  stable/12/sys/kern/kern_sig.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_sig.c
==============================================================================
--- stable/12/sys/kern/kern_sig.c       Wed Sep  9 23:06:35 2020        
(r365544)
+++ stable/12/sys/kern/kern_sig.c       Wed Sep  9 23:11:55 2020        
(r365545)
@@ -3760,7 +3760,8 @@ nosys(struct thread *td, struct nosys_args *args)
                uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
                    td->td_sa.code);
        }
-       if (kern_lognosys == 2 || kern_lognosys == 3) {
+       if (kern_lognosys == 2 || kern_lognosys == 3 ||
+           (p->p_pid == 1 && (kern_lognosys & 3) == 0)) {
                printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm,
                    td->td_sa.code);
        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to