mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Use crcopysafe(9) to make a copy of a process' credential struct. crcopy(9)
may perform a blocking memory allocation, which is unsafe when holding a mutex. Differential Revision: https://reviews.freebsd.org/D1443 Reviewed by: rwatson MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
08b96b9ff5
commit
bbd685e3a5
1 changed files with 1 additions and 2 deletions
|
|
@ -102,8 +102,7 @@ sys_cap_enter(struct thread *td, struct cap_enter_args *uap)
|
|||
newcred = crget();
|
||||
p = td->td_proc;
|
||||
PROC_LOCK(p);
|
||||
oldcred = p->p_ucred;
|
||||
crcopy(newcred, oldcred);
|
||||
oldcred = crcopysafe(p, newcred);
|
||||
newcred->cr_flags |= CRED_FLAG_CAPMODE;
|
||||
p->p_ucred = newcred;
|
||||
PROC_UNLOCK(p);
|
||||
|
|
|
|||
Loading…
Reference in a new issue