svn commit: r236239 - stable/9/sys/kern

Edward Tomasz Napierala trasz at FreeBSD.org
Tue May 29 15:08:36 UTC 2012


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);
 }
 


More information about the svn-src-stable-9 mailing list