Date: Tue, 29 May 2012 15:08:35 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r236239 - stable/9/sys/kern Message-ID: <201205291508.q4TF8ZYf085835@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205291508.q4TF8ZYf085835>