From nobody Thu Sep 18 08:52:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cS8X33qTtz681t1; Thu, 18 Sep 2025 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cS8X31gsyz3hmY; Thu, 18 Sep 2025 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758185523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E27WHRf2aHlK7yHXr0dYa2XPuJVNlAXhkNHLyg6L/f4=; b=yzxEtyhz7PtqWN/d3w+adeqIKpLHCbkAENi1QPXjdus1IEKVQO5EJRFTdb0tN2XAfRHpf3 3xl1SSnFp9TKh90RJ01p2+FUOGoyEX0Khzzy0HxnMhILmf2W6DNvYwr4V4rvsJpecYXUOI IsRz2nA3c9JnuD1vKwTbSRcyBQrdqIzmefz58c8gUmzr9yA84+DJiTOopvCk/7ZoFVFOiW IZ42UllODEhAnQe/GXSkRv7hVeLgzxTz+iLObEyNWhHgw/TymyMyJHxujBXqfWf0M/VStk AJJjLbW0fw/mH8AAh5n5hWzdKO4SU6MoBpuojIesg05fBYeL99mlIUwuJSbqsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758185523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E27WHRf2aHlK7yHXr0dYa2XPuJVNlAXhkNHLyg6L/f4=; b=jCeO0UylOkvrVFxwvKUI92qWVbuo2PsBgTlnYdNcGGcDFToPrRk/fj49Np+A3dP0CY1DSm KvBoobibqzxVTWOpF2RXasxqr+wLl6AJxJkxE5gpeR0bRpRkpICC1sZxynBPE6dKF8aqlv 4q5EKks/kcZtQoh31d8K8117d3ms1Fr3R6qEHAdRnDAzS/ItWWsW/yEmz1FcdoInlrI0jq Bb8QW2VkqoCdNvAqqKj+Efonq50P9gua2gxyJNh5HdYvINueoouWQjXkP2h8FcLuj+ddDA o3ZHVpRK2L39nZsBsfqi7TI1ibpsxNozMHsx5NlNJLLN6RkHvAo5Nt0ywWU+3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758185523; a=rsa-sha256; cv=none; b=XQr0jqqtz1eYYAEnGeNac2W3N+rFTgdGrDzF2+hoKNSiXjaeaGS2Ko/ssPLUcKejqnt+Ge 2Kt7T13FJS52CkRlUsA00mbJ5DEHV5R5iM63r6z6Hzdv+Vn2Psvyg9+32ik0ykSb/VyIBQ qcEYtTNAzdr9hKPAW3CTBpSgi+6UtXqFJArPYMxCpy8H0a/Fs4LOCJp9tYHjkAOpl5yLYC 2rPSzlFlk5Lv2pWCxx92fpelScEM/XwzcH88Ngj5VUh0mgIFghPNfjNqIMXDBoN+rJqz48 r5BNjKhkjFB7apOsFhxeES7otfjNuYcngtmQR+xOmw6/51C3NmqhT0kCtgY6sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cS8X30zM7z14M0; Thu, 18 Sep 2025 08:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58I8q3jT018820; Thu, 18 Sep 2025 08:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58I8q385018817; Thu, 18 Sep 2025 08:52:03 GMT (envelope-from git) Date: Thu, 18 Sep 2025 08:52:03 GMT Message-Id: <202509180852.58I8q385018817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 96a2fc56439e - stable/15 - imgact_elf: procstat groups: Restore sending the effective GID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 96a2fc56439ebd58622c484944ada9f2d4f2f468 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=96a2fc56439ebd58622c484944ada9f2d4f2f468 commit 96a2fc56439ebd58622c484944ada9f2d4f2f468 Author: Olivier Certner AuthorDate: 2025-08-26 13:41:49 +0000 Commit: Olivier Certner CommitDate: 2025-09-18 08:50:30 +0000 imgact_elf: procstat groups: Restore sending the effective GID Fixes 'procstat -s' run on a core file when the number of groups in effect at the moment of core dump exceeds KI_NGROUPS (16). Reviewed by: kib Fixes: be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]") MFC after: 9 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52258 (cherry picked from commit 5568b4441dff078733a76835312a6ce1ccb50a17) --- sys/kern/imgact_elf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 5a53fac50f2c..1bc2491a1a12 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2610,11 +2610,13 @@ note_procstat_groups(void *arg, struct sbuf *sb, size_t *sizep) int structsize; p = arg; - size = sizeof(structsize) + p->p_ucred->cr_ngroups * sizeof(gid_t); + size = sizeof(structsize) + + (1 + p->p_ucred->cr_ngroups) * sizeof(gid_t); if (sb != NULL) { KASSERT(*sizep == size, ("invalid size")); structsize = sizeof(gid_t); sbuf_bcat(sb, &structsize, sizeof(structsize)); + sbuf_bcat(sb, &p->p_ucred->cr_gid, sizeof(gid_t)); sbuf_bcat(sb, p->p_ucred->cr_groups, p->p_ucred->cr_ngroups * sizeof(gid_t)); }