mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
PP mutexes: unlock: Reset inherited prio regardless of privileges
'uq_inherited_pri' contains the current priority inherited from Priority Protection mutexes. If -1 is passed through 'm_ceilings[1]', meaning that there are no such mutexes held anymore, this must be reflected into it by setting it to PRI_MAX, regardless of whether the thread has privilege to set realtime priorities (PRI_MAX is also obviously not a realtime priority level). By contrast, it shall not be updated and the computed 'new_inherited_pri' shall stay unused if the thread doesn't have the ability to set a realtime priority, possibly keeping an older such priority acquired previously. Reviewed by: kib Approved by: emaste (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43984
This commit is contained in:
parent
5acbe6d1fb
commit
1df8700aa6
1 changed files with 3 additions and 2 deletions
|
|
@ -2684,7 +2684,8 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb)
|
|||
struct umtx_q *uq, *uq2;
|
||||
struct umtx_pi *pi;
|
||||
uint32_t id, owner, rceiling;
|
||||
int error, pri, new_inherited_pri, su;
|
||||
int error, pri, new_inherited_pri;
|
||||
bool su;
|
||||
|
||||
id = td->td_tid;
|
||||
uq = td->td_umtxq;
|
||||
|
|
@ -2739,7 +2740,7 @@ do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags, bool rb)
|
|||
error = EFAULT;
|
||||
else {
|
||||
mtx_lock(&umtx_lock);
|
||||
if (su != 0)
|
||||
if (su || new_inherited_pri == PRI_MAX)
|
||||
uq->uq_inherited_pri = new_inherited_pri;
|
||||
pri = PRI_MAX;
|
||||
TAILQ_FOREACH(pi, &uq->uq_pi_contested, pi_link) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue