From nobody Tue Sep 23 12:03:29 2025 X-Original-To: dev-commits-src-branches@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 4cWJXf2vn5z68Xgm; Tue, 23 Sep 2025 12:03:30 +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 4cWJXd6zzjz3DPy; Tue, 23 Sep 2025 12:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758629010; 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=KRGEzeVUj1Fz1Pyw77HeAlBA93SMS6J8KQ3rVN5f9ms=; b=G4t74vCvRAxld5u3sT4yJr2K3jfoxFmtudQOBISS2eGe0ec7JfC9K1C2LboL3R/MKCjoGv iMTHwawMe5NXuFlglgyLnitdAqYxSwQl/rnqNElklZwQtYGJoakz9Or62E5FlAiALwB/Ud xF6Ym+jjnHYuPUIz2+5LQ1fes7hW9ofJsO3Qty7BMiIDrg8X9GlTPRNP7vPQ4f5G7IN2f+ sWAkuHJdpdrNsZlgzfuNQx7n42OMyCmW+Rd4/pP3IbqCXX9zeFi1cE3OKCEws1j/LCD8Vx rKeAhlGSTatNIgoF2YTkqlQgOXApG7KjsTTC7ELJ9SurkdUZVINu8fQrMufxew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758629010; 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=KRGEzeVUj1Fz1Pyw77HeAlBA93SMS6J8KQ3rVN5f9ms=; b=KdDf6BYJOXQ6Aig3ad6nTGFPdU3xxNDfDdEWVQrC82+mpZeDV7pIsg80IPTH1DwIKJP2Mp nO95By5zNMHGsky0tjkUW9jg2rgRoB+0iElAxYF+6s8SWGu3MeOPt+x5T74jJ05mGEUtqs HrqSsokp499P3efpGG00Q922oINBnRhsU4bhuRBk2ImdwbSZxQR7tyOZ0p+eA6JzSFVzUt wImsvdEiUpQ2+hANBhLT8FmnCryUGkeKv3SsuI2VFphtHTMSOA3Xio7nZswL1a6CmoJnjc qpwJkYGnHOQLN6ksrAfr+ttPVpy+Y1c7PmWBgjO4ZJ6mJF9tJFwRpIkcKqa/+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758629010; a=rsa-sha256; cv=none; b=FJED473ZfA26zuuzZXqej2RYrk/cbCsj9z3/m4J8TfHUVaFWZs5UiOWvwsPA1xkVCut6XL FgWM2SGt+cHCywS+ODgjY2l1aNnQbTZyz/45xwWeK5uYbXa+PBQR+AtA9uHEesUW5YRV67 SYHyF1UXNxpMDvD1TPc2Vs2ZgHdu5B6bDMsx2I5biSTkC+GkjqAJt+acfswtdCJfNcc88s O5Oah/gDfpuONRbxxsTYNX4r9MoXkSkFbSGlrHRdF7lhila4bXnx6XhxW9Lux0n6gW3Jh/ lNNa3ci81HDthadVQtINWKunnUUpRSKnHrNhPaWYcxi/9v2JmTXwYNk3sPpKIw== 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 4cWJXd6bCJzllV; Tue, 23 Sep 2025 12:03:29 +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 58NC3Trl008329; Tue, 23 Sep 2025 12:03:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58NC3T6w008326; Tue, 23 Sep 2025 12:03:29 GMT (envelope-from git) Date: Tue, 23 Sep 2025 12:03:29 GMT Message-Id: <202509231203.58NC3T6w008326@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: 8cda100def08 - stable/15 - cred: 'kern.ngroups' tunable: Rework the comment on the initial value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 8cda100def084709cd567b3fcd42325af40094d6 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8cda100def084709cd567b3fcd42325af40094d6 commit 8cda100def084709cd567b3fcd42325af40094d6 Author: Olivier Certner AuthorDate: 2025-08-27 13:50:59 +0000 Commit: Olivier Certner CommitDate: 2025-09-23 12:02:41 +0000 cred: 'kern.ngroups' tunable: Rework the comment on the initial value Remove the parts about the effective GID being stored as the first element of the groups array, as this is generally not the case now after commit be1f7435ef21 ("kern: start tracking cr_gid outside of cr_groups[]") (some credentials export structures still have the old layout, and need to do the 'ngroups_max + 1' computation, but given the computation needed to obtain a size in bytes, this detail is not really important here). Remove the part about 32-bit machines, avoiding another modification when support for them is removed. No functional change. MFC after: 5 days MFC to: stable/15 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52265 (cherry picked from commit a61e7b5c98f840b4a7777d718218d0f63569c52a) --- sys/kern/subr_param.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 471640c290a7..a67e5fa6cbff 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -235,14 +235,11 @@ init_param1(void) * specification for , paragraph "Runtime Increasable * Values"). * - * On the other hand, INT_MAX would result in an overflow for the common - * 'ngroups_max + 1' computation (to obtain the size of the internal - * groups array, its first element being reserved for the effective - * GID). Also, the number of allocated bytes for the group array must - * not overflow on 32-bit machines. For all these reasons, we limit the - * number of supplementary groups to some very high number that we - * expect will never be reached in all practical uses and ensures we - * avoid the problems just exposed, even if 'gid_t' was to be enlarged + * On the other hand, a too high value would result in an overflow when + * computing the number of bytes to allocate for the groups array. We + * thus limit the number of supplementary groups to some very high + * number that we expect will never be reached in all practical uses, + * avoiding the problem just exposed even if 'gid_t' were to be enlarged * by a magnitude. */ ngroups_max = NGROUPS_MAX;