Changeset View
Changeset View
Standalone View
Standalone View
sys/security/mac_lomac/mac_lomac.c
Show First 20 Lines • Show All 2,250 Lines • ▼ Show 20 Lines | if ((subj->mac_lomac.ml_flags & MAC_LOMAC_FLAG_UPDATE) == 0) { | ||||
crfree(newcred); | crfree(newcred); | ||||
goto out; | goto out; | ||||
} | } | ||||
oldcred = p->p_ucred; | oldcred = p->p_ucred; | ||||
crcopy(newcred, oldcred); | crcopy(newcred, oldcred); | ||||
crhold(newcred); | crhold(newcred); | ||||
lomac_copy(&subj->mac_lomac, SLOT(newcred->cr_label)); | lomac_copy(&subj->mac_lomac, SLOT(newcred->cr_label)); | ||||
proc_set_cred(p, newcred); | proc_set_cred(p, newcred); | ||||
FOREACH_THREAD_IN_PROC(p, td) { | |||||
thread_lock(td); | |||||
if (TD_IS_SUGID(td)) { | |||||
lomac_copy(&subj->mac_lomac, | |||||
SLOT(td->td_ucred->cr_label)); | |||||
} | |||||
thread_unlock(td); | |||||
} | |||||
crfree(oldcred); | crfree(oldcred); | ||||
dodrop = 1; | dodrop = 1; | ||||
out: | out: | ||||
mtx_unlock(&subj->mtx); | mtx_unlock(&subj->mtx); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
if (dodrop) | if (dodrop) | ||||
mac_proc_vm_revoke(curthread); | mac_proc_vm_revoke(curthread); | ||||
mtx_unlock(&Giant); | mtx_unlock(&Giant); | ||||
▲ Show 20 Lines • Show All 799 Lines • Show Last 20 Lines |