From owner-svn-src-all@FreeBSD.ORG Tue May 29 15:08:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16D48106564A; Tue, 29 May 2012 15:08:36 +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 008EC8FC08; Tue, 29 May 2012 15:08:36 +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 q4TF8Znv085838; Tue, 29 May 2012 15:08:35 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4TF8ZYf085835; Tue, 29 May 2012 15:08:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201205291508.q4TF8ZYf085835@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 29 May 2012 15:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236239 - stable/9/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, 29 May 2012 15:08:36 -0000 Author: trasz Date: Tue May 29 15:08:35 2012 New Revision: 236239 URL: http://svn.freebsd.org/changeset/base/236239 Log: MFC r235787: Fix panic with RACCT that could occur in low memory (or out of swap) situations, due to fork1() calling racct_proc_exit() without calling racct_proc_fork() first. Modified: stable/9/sys/kern/kern_fork.c stable/9/sys/kern/kern_racct.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_fork.c ============================================================================== --- stable/9/sys/kern/kern_fork.c Tue May 29 14:50:21 2012 (r236238) +++ stable/9/sys/kern/kern_fork.c Tue May 29 15:08:35 2012 (r236239) @@ -939,8 +939,8 @@ fail: #ifdef MAC mac_proc_destroy(newproc); #endif -fail1: racct_proc_exit(newproc); +fail1: if (vm2 != NULL) vmspace_free(vm2); uma_zfree(proc_zone, newproc); Modified: stable/9/sys/kern/kern_racct.c ============================================================================== --- stable/9/sys/kern/kern_racct.c Tue May 29 14:50:21 2012 (r236238) +++ stable/9/sys/kern/kern_racct.c Tue May 29 15:08:35 2012 (r236239) @@ -573,6 +573,9 @@ out: PROC_UNLOCK(child); PROC_UNLOCK(parent); + if (error != 0) + racct_proc_exit(child); + return (error); }