From nobody Tue Sep 9 15:58:04 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 4cLpPn1StGz675vT; Tue, 09 Sep 2025 15:58:05 +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 4cLpPm3L63z499M; Tue, 09 Sep 2025 15:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757433484; 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=+SV+n0ksH6ar1rhPsw1P4YCiE8e5HubuLr05AjCCy6w=; b=XXwMfBQBcrG3Nnk2i7YO3fRUY1X+Os+/xSC8lZC9W0rHaQJ5KQoKksyLnciY031Cn9eGy5 P2MkvrlSA/kJgoVdhMSMYeelQbZZ/vJPoshRnInkV5CjGZw2WnuZsYbh/oPpTYJjaXzZCW uDAXeLs+eEoMnboZkPVR/iWJMF+0tCfSo9BPPdaVkFJXkaGyY7/5Ogh6WtLIsbvGFbu427 WsmwJ6C//Fydb6pX77ETTQlNQFy+VBcajijFKfS93r1u3hLpH4ALzICX8wxSMQ5LoCJXdU 0KlrQeOHsrkFlr8WoNNn3eMB7u0y2tLs9eBGjwkWK0NXKhwaFArT79nUnFBIWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757433484; 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=+SV+n0ksH6ar1rhPsw1P4YCiE8e5HubuLr05AjCCy6w=; b=rYwfFLtjfNKHmOk4DC67ijqFw2IKWh8ji/Uf1MOOwrvNQlEB3GSLu4/Zlj6cB8ys6Soogj q+sFFrbk+rjuVLHaHQGalOTdQDXCZp51FK89rmKLQT4LevLYJoz76ySCKEsE0vwutIE/S/ BVj/iuPox/abaYFbUn8EN3aX/luMRXZaOlZUsMSXjgbd/rcBLgvicOaFFd5kuxlnBsM5OT KlEb6IfRNKMW1R46a1OusPSyhe1dp9BQGP6f1DtIAH7aCYOGj15dDk+W478mWwSA6522TW UPyieBpfSkSL+JMjWRZ/lEsCQratDLmDJHq814BeneeZvWlF8SIpsdGTvzVzDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757433484; a=rsa-sha256; cv=none; b=WsqEUGuMLtqc5U+ctfM0TYkkbY7eE7XK1zPYUbYbvH2nM8zBW2qhqzk/tHtj3RvTGhL3vy uyYWJ1iiX6av3WEBFLNEKxKgXN2tAgtgaQogGmWhObuRRHaesBmG/614M7J04/0wyeaaXS 1YiJaHJU4knzxgfVLYeMm3skt5xKmR4iYmuQWRKtTZkWgm9//K0nUSmtj02ZsaRyHgIi6G IhSGoYQO2JI+zW5efzZ2GjKFJA9wQwDF6la8DZKUSgFaPl4oHoKuUVBWgoQtsiZ19qGL0G fW9r3pfNRXB40YSru0s51DCDU4qVsVKStvczTGhohclTi/eASJiGpYyTWAg3lQ== 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 4cLpPm2mv7zjxB; Tue, 09 Sep 2025 15:58:04 +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 589Fw4j7039435; Tue, 9 Sep 2025 15:58:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 589Fw4f8039431; Tue, 9 Sep 2025 15:58:04 GMT (envelope-from git) Date: Tue, 9 Sep 2025 15:58:04 GMT Message-Id: <202509091558.589Fw4f8039431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 5568b4441dff - main - 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/main X-Git-Reftype: branch X-Git-Commit: 5568b4441dff078733a76835312a6ce1ccb50a17 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5568b4441dff078733a76835312a6ce1ccb50a17 commit 5568b4441dff078733a76835312a6ce1ccb50a17 Author: Olivier Certner AuthorDate: 2025-08-26 13:41:49 +0000 Commit: Olivier Certner CommitDate: 2025-09-09 15:56:48 +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 --- 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)); }