Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Sep 2020 23:14:17 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r365864 - stable/11/sys/kern
Message-ID:  <202009172314.08HNEHn3083424@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Thu Sep 17 23:14:17 2020
New Revision: 365864
URL: https://svnweb.freebsd.org/changeset/base/365864

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/11/sys/kern/kern_sig.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_sig.c
==============================================================================
--- stable/11/sys/kern/kern_sig.c	Thu Sep 17 22:29:38 2020	(r365863)
+++ stable/11/sys/kern/kern_sig.c	Thu Sep 17 23:14:17 2020	(r365864)
@@ -3731,7 +3731,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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009172314.08HNEHn3083424>