svn commit: r225426 - head/sys/kern
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Sep 6 17:22:41 UTC 2011
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.
*/
More information about the svn-src-all
mailing list