mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- The prison mutex cannot possibly protect pointers to the prison it
protects, so don't bother locking it while we assign it to a ucred's cr_prison. - Fully construct the new credential for a process before assigning it to p_ucred.
This commit is contained in:
parent
e674d80790
commit
69c4ee54ff
1 changed files with 1 additions and 3 deletions
|
|
@ -218,10 +218,8 @@ jail_attach(td, uap)
|
|||
oldcred = p->p_ucred;
|
||||
setsugid(p);
|
||||
crcopy(newcred, oldcred);
|
||||
newcred->cr_prison = pr;
|
||||
p->p_ucred = newcred;
|
||||
mtx_lock(&pr->pr_mtx);
|
||||
p->p_ucred->cr_prison = pr;
|
||||
mtx_unlock(&pr->pr_mtx);
|
||||
PROC_UNLOCK(p);
|
||||
crfree(oldcred);
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue