- 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
@ -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…
x
Reference in New Issue
Block a user