summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_umtx.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-09-03 00:07:37 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-09-03 00:07:37 +0000
commitb73a4c5234b73294179df7c1a7931d1cb2d13226 (patch)
treeab71a6a287bbfd5afc625291f143d2957284e8d5 /sys/kern/kern_umtx.c
parent30c9ad00f1ed82f38f2e6a231af2e09f1475f002 (diff)
downloadFreeBSD-src-b73a4c5234b73294179df7c1a7931d1cb2d13226.zip
FreeBSD-src-b73a4c5234b73294179df7c1a7931d1cb2d13226.tar.gz
Check if it is root user in do_unlock_pp.
Diffstat (limited to 'sys/kern/kern_umtx.c')
-rw-r--r--sys/kern/kern_umtx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 2c41fe0..25ff748 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -1827,10 +1827,11 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags)
struct umtx_pi *pi;
uint32_t owner, id;
uint32_t rceiling;
- int error, pri, new_inherited_pri;
+ int error, pri, new_inherited_pri, su;
id = td->td_tid;
uq = td->td_umtxq;
+ su = (suser(td) == 0);
/*
* Make sure we own this mtx.
@@ -1879,7 +1880,8 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags)
error = EFAULT;
else {
mtx_lock_spin(&sched_lock);
- uq->uq_inherited_pri = new_inherited_pri;
+ if (su != 0)
+ uq->uq_inherited_pri = new_inherited_pri;
pri = PRI_MAX;
TAILQ_FOREACH(pi, &uq->uq_pi_contested, pi_link) {
uq2 = TAILQ_FIRST(&pi->pi_blocked);
OpenPOWER on IntegriCloud