Author: mjg
Date: Wed May  6 21:03:19 2015
New Revision: 282567
URL: https://svnweb.freebsd.org/changeset/base/282567

Log:
  Fix up panics when fork fails due to hitting proc limit
  
  The function clearning credentials on failure asserts the process is a
  zombie, which is not true when fork fails.
  
  Changing creds to NULL is unnecessary, but is still being done for
  consistency with other code.
  
  Pointy hat: mjg
  Reported by: pho

Modified:
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c   Wed May  6 19:58:12 2015        (r282566)
+++ head/sys/kern/kern_fork.c   Wed May  6 21:03:19 2015        (r282567)
@@ -943,7 +943,8 @@ fail:
 #endif
        racct_proc_exit(newproc);
 fail1:
-       crfree(proc_set_cred(newproc, NULL));
+       crfree(newproc->p_ucred);
+       newproc->p_ucred = NULL;
 fail2:
        if (vm2 != NULL)
                vmspace_free(vm2);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to