Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Sep 2014 04:50:10 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 1199102 for review
Message-ID:  <201409080450.s884oAPv023810@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@1199102?ac=10

Change 1199102 by jhb@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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409080450.s884oAPv023810>