aboutsummaryrefslogtreecommitdiff
path: root/sys/security
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2022-11-15 14:31:41 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2022-11-15 14:31:41 +0000
commit60bae7ec045a8af6e9c51ac080e51948fe84bb4d (patch)
treee210786841c4fa58f0b75679196be904297f799c /sys/security
parentc3f1a13902c15f350d59335e99c8945e515a915c (diff)
downloadsrc-60bae7ec045a8af6e9c51ac080e51948fe84bb4d.tar.gz
src-60bae7ec045a8af6e9c51ac080e51948fe84bb4d.zip
mac_lomac: whack giant usage
It does not protect anything, the code looks dodgy regardless.
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac_lomac/mac_lomac.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c
index 5efcfe385cd5..dffd06d964a2 100644
--- a/sys/security/mac_lomac/mac_lomac.c
+++ b/sys/security/mac_lomac/mac_lomac.c
@@ -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);
}