PERFORCE change 1199102 for review

John Baldwin jhb at FreeBSD.org
Mon Sep 8 04:51:04 UTC 2014


http://p4web.freebsd.org/@@1199102?ac=10

Change 1199102 by jhb at jhb_pippin on 2014/08/22 21:17:04

	Fix mismerge that caused lock recursion.

Affected files ...

.. //depot/projects/smpng/sys/kern/kern_exec.c#154 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_exec.c#154 (text+ko) ====

@@ -614,18 +614,6 @@
 	VREF(binvp);
 
 	/*
-	 * Force the process to use this thread's credentials to avoid
-	 * a race where another thread changed this process' credentials
-	 * while we were waiting for all other threads to stop.
-	 */
-	PROC_LOCK(p);
-	if (td->td_ucred != p->p_ucred) {
-		oldcred = p->p_ucred;
-		p->p_ucred = crhold(td->td_ucred);
-		crfree(oldcred);
-	}
-
-	/*
 	 * For security and other reasons, signal handlers cannot
 	 * be shared after an exec. The new process gets a copy of the old
 	 * handlers. In execsigs(), the new process will have its signals
@@ -643,7 +631,19 @@
 	PROC_LOCK(p);
 	if (oldsigacts)
 		p->p_sigacts = newsigacts;
+
+	/*
+	 * Force the process to use this thread's credentials to avoid
+	 * a race where another thread changed this process' credentials
+	 * while we were waiting for all other threads to stop.
+	 */
+	if (td->td_ucred != p->p_ucred) {
+		oldcred = p->p_ucred;
+		p->p_ucred = crhold(td->td_ucred);
+		crfree(oldcred);
+	}
 	oldcred = p->p_ucred;
+
 	/* Stop profiling */
 	stopprofclock(p);
 


More information about the p4-projects mailing list