From nobody Tue Sep 23 12:03:40 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 4cWJXs4w7Cz68YCL; Tue, 23 Sep 2025 12:03:41 +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 4cWJXr15wGz3DgQ; Tue, 23 Sep 2025 12:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758629020; 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=j1TFitXj2BaCiUe+U/39eth1EbtJwIYY6fzS7Ec/m6o=; b=FkAxeD+zyiAzBHcQcjEVtSmE5sGoE5+XW5wvHIrrdOPflLdtRuJ5ye/dakwYE2NknA4LSK 3UsDLbFlpxMS0LtDtZ47gH+aw5Up4k/lz1YFKTe8g4fuyQU7ONusC66VDthnwYBnq7PMJ+ AednXpR+px8znXkQrq9MB0bp5+1sZmxrcnCgSZ1mtQKbegAZfKMqea4RTdMYDfSGCx2mFE Ne03OQSoPsf5QE8zNSh0e0IntPWCeTVAu4JgT7gJ7n/ZSROFUfgU56ZrgXVKdN3y51YQ7T Erh/tlIeegP4pmsG5PhtCqZ91cO7QuNv8XF8570NwXdo4ktxnJdC5iU1cT0GgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758629020; 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=j1TFitXj2BaCiUe+U/39eth1EbtJwIYY6fzS7Ec/m6o=; b=SLUcTcdad/2VsTbWB9LSOvMGCbQRkVvDeF+cBhbdInuA8nf021TL5pjjMP/S96BRM6AL28 J8GkSJBzd373Sx7zJHg+CqVRq4ogofG/UVhnP45stvRHuMn+E06dS8Mi6U9pg4TqhfpDwN 8A4M1/EqbA5X3IHCpx9713EFrnF9W6AZdnTqdeYqFiP91VezlWlV2EeZX9wMXmuGepa8r2 GqLs+UHyy022aewCiSB3Ky3pc1o1nfrwfbSJIEYXuwpZmWYYUW38i3SQUmuQE0f46C4p/T oqvVzOBa21G/STtR/Ln5GcCamNlAcDqrzxL8Unly9lh1V9FfPHUygIUBe81G3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758629020; a=rsa-sha256; cv=none; b=Y1rZ5mp5bn0MdSgMKEOAGx6/37D+KrtjSYGqS3ZQ00pHxh0UbRp5sHf8E2wfz5tPUEw0NR Wzs9oy/vDBaTGM8pPjH960pOQsC6vSay7gEBa7HkOADWv4ikYkeWjeB09RpJnT1jeSKI1K HU1aGuDsT8T2VlalUC0hIW4gvBdds+Du8vcLw6q6pcp2CXsxKZYHpgs9O59kMfAETLs8R4 jzpSfu1vwhmey4QmfZglFQZ3myvPttnvaglUVJF0PCIbr5XZ84A7/aq4jHva3sLnOa8jm7 pJddM0Kd/Wn18dOTivbs0UVE+yCYwBdC4vRz1KyoiwXp2In3X57SadihH6ok1Q== 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 4cWJXr0hxNzlcj; Tue, 23 Sep 2025 12:03:40 +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 58NC3egm008653; Tue, 23 Sep 2025 12:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58NC3ebk008650; Tue, 23 Sep 2025 12:03:40 GMT (envelope-from git) Date: Tue, 23 Sep 2025 12:03:40 GMT Message-Id: <202509231203.58NC3ebk008650@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: 469c3a4139fe - stable/15 - linux: setgroups(): Fix the group number's upper limit 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: 469c3a4139fe85b092734b0af9dbc167a8ebbf1e Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=469c3a4139fe85b092734b0af9dbc167a8ebbf1e commit 469c3a4139fe85b092734b0af9dbc167a8ebbf1e Author: Olivier Certner AuthorDate: 2025-08-28 16:58:53 +0000 Commit: Olivier Certner CommitDate: 2025-09-23 12:02:44 +0000 linux: setgroups(): Fix the group number's upper limit 'ngroups_max' is the maximum number of supplementary groups the system will accept, and this has not changed. Fixes: 9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms") MFC after: 5 days MFC to: stable/15 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52277 (cherry picked from commit bbdea7c9f4aeae26b35f842382df0203fcda24a5) --- sys/compat/linux/linux_misc.c | 2 +- sys/compat/linux/linux_uid16.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 755eae057406..fb86de6e7302 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1034,7 +1034,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args) int error; struct proc *p; - if (ngrp < 0 || ngrp >= ngroups_max) + if (ngrp < 0 || ngrp > ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK); error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 07430f5b399b..dd681f971746 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -91,7 +91,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) int error; struct proc *p; - if (ngrp < 0 || ngrp >= ngroups_max) + if (ngrp < 0 || ngrp > ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));