PERFORCE change 107251 for review

Robert Watson rwatson at FreeBSD.org
Wed Oct 4 07:41:40 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=107251

Change 107251 by rwatson at rwatson_zoo on 2006/10/04 14:29:54

	Catch up with new super-user checks: there's a rather nasty race
	in umtx priority propagation in the event we allow privileges to be
	revoked, and I have e-mailed davidxu about ensuring that restore
	of priority is done unconditionally.

Affected files ...

.. //depot/projects/trustedbsd/priv/sys/kern/kern_umtx.c#4 edit

Differences ...

==== //depot/projects/trustedbsd/priv/sys/kern/kern_umtx.c#4 (text+ko) ====

@@ -34,6 +34,7 @@
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>
+#include <sys/priv.h>
 #include <sys/proc.h>
 #include <sys/sched.h>
 #include <sys/sysctl.h>
@@ -1607,7 +1608,7 @@
 	if ((error = umtx_key_get(m, TYPE_PP_UMUTEX, GET_SHARE(flags),
 	    &uq->uq_key)) != 0)
 		return (error);
-	su = (suser(td) == 0);
+	su = (priv_check(td, PRIV_SCHED_RTPRIO) == 0);
 	for (;;) {
 		old_inherited_pri = uq->uq_inherited_pri;
 		umtxq_lock(&uq->uq_key);
@@ -1728,7 +1729,7 @@
 
 	id = td->td_tid;
 	uq = td->td_umtxq;
-	su = (suser(td) == 0);
+	su = (priv_check(td, PRIV_SCHED_RTPRIO) == 0);
 
 	/*
 	 * Make sure we own this mtx.


More information about the trustedbsd-cvs mailing list