mac_lomac: whack giant usage

It does not protect anything, the code looks dodgy regardless.
This commit is contained in:
Mateusz Guzik 2022-11-15 14:31:41 +00:00
parent c3f1a13902
commit 60bae7ec04

View file

@ -2248,12 +2248,6 @@ lomac_thread_userret(struct thread *td)
dodrop = 0;
mtx_unlock(&subj->mtx);
newcred = crget();
/*
* Prevent a lock order reversal in mac_proc_vm_revoke;
* ideally, the other user of subj->mtx wouldn't be holding
* Giant.
*/
mtx_lock(&Giant);
PROC_LOCK(p);
mtx_lock(&subj->mtx);
/*
@ -2275,7 +2269,6 @@ lomac_thread_userret(struct thread *td)
PROC_UNLOCK(p);
if (dodrop)
mac_proc_vm_revoke(curthread);
mtx_unlock(&Giant);
} else {
mtx_unlock(&subj->mtx);
}