git: fa96d3e64efc - stable/15 - linux: setgroups(): Avoid allocation under the process lock
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 23 Sep 2025 12:03:41 UTC
The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fa96d3e64efc8f789524f3871bc4e68f61d3d213 commit fa96d3e64efc8f789524f3871bc4e68f61d3d213 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2025-08-28 15:47:38 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2025-09-23 12:02:44 +0000 linux: setgroups(): Avoid allocation under the process lock This was missed in commit 838d9858251e ("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 (cherry picked from commit b7a87d7c0dd19016e82f5d33f2c5ec90479c31fe) --- sys/compat/linux/linux_misc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index fb86de6e7302..0925ffb64480 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -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);