linux: setgroups(): Avoid allocation under the process lock
This was missed in commit 838d985825 ("Rework the credential code to
support larger values of NGROUPS (...)").
No functional change (intended).
MFC after: 5 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52278
This commit is contained in:
@@ -1045,8 +1045,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
|
||||
crextend(newcred, ngrp);
|
||||
p = td->td_proc;
|
||||
PROC_LOCK(p);
|
||||
oldcred = p->p_ucred;
|
||||
crcopy(newcred, oldcred);
|
||||
oldcred = crcopysafe(p, newcred);
|
||||
|
||||
if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS)) != 0) {
|
||||
PROC_UNLOCK(p);
|
||||
|
||||
Reference in New Issue
Block a user