Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Sep 2011 17:22:41 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225426 - head/sys/kern
Message-ID:  <201109061722.p86HMf0P094437@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Sep  6 17:22:40 2011
New Revision: 225426
URL: http://svn.freebsd.org/changeset/base/225426

Log:
  Work around a kernel panic triggered by forkbomb with an rctl rule
  such as j:name:maxproc:sigkill=100.  Proper fix - deferring psignal
  to a taskqueue - is somewhat complicated and thus will happen
  after 9.0.
  
  Approved by:	re (kib)

Modified:
  head/sys/kern/kern_rctl.c

Modified: head/sys/kern/kern_rctl.c
==============================================================================
--- head/sys/kern/kern_rctl.c	Tue Sep  6 17:21:39 2011	(r225425)
+++ head/sys/kern/kern_rctl.c	Tue Sep  6 17:22:40 2011	(r225426)
@@ -363,6 +363,17 @@ rctl_enforce(struct proc *p, int resourc
 			     rule->rr_action));
 
 			/*
+			 * We're supposed to send a signal, but the process
+			 * is not fully initialized yet, probably because we
+			 * got called from fork1().  For now just deny the
+			 * allocation instead.
+			 */
+                        if (p->p_state != PRS_NORMAL) {
+				should_deny = 1;
+				continue;
+			}
+
+			/*
 			 * We're using the fact that RCTL_ACTION_SIG* values
 			 * are equal to their counterparts from sys/signal.h.
 			 */



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