From owner-svn-src-all@FreeBSD.ORG Tue Sep 6 17:22:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452FC106564A; Tue, 6 Sep 2011 17:22:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 343328FC16; Tue, 6 Sep 2011 17:22:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p86HMfZc094439; Tue, 6 Sep 2011 17:22:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p86HMf0P094437; Tue, 6 Sep 2011 17:22:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201109061722.p86HMf0P094437@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 6 Sep 2011 17:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225426 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2011 17:22:41 -0000 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. */