From nobody Fri Nov 15 10:49:04 2024 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 4XqYfn2gn0z5cygy; Fri, 15 Nov 2024 10:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XqYfm68n0z4WwS; Fri, 15 Nov 2024 10:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731667744; 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=4CA9HjNJOAXrT3UeOfqfEgk/0cPfKtrlO3sexfMjoZo=; b=FeFkYnvMFw6ikMoQhzOvvVdPX9eCzFfOny7gdcGT6yZ+Ao6/fOV1vUfhsISzI0lVtwbyop rxOGAzkJ27vlIsMWNdpVtcrAP0NY0xtR3xTCHEr58QOhjtWlyUz91883M6Ml7jOb1bAI3H DljGCiYdG8WuYB3hM4vt3VGBHFZHHMErfBOuwD3fUCFyiBuUo+eWal7ohwAwFK1v5SFVLv HXVu6NtjmhK6GU7m4o9AK+ItIzWT4nJ9tzQHib/qAEVqbVuN2L8nOb251Jjd1GPpnZ5beO ekN4Ru+3KT2IgC+OIUoLx5+fwQjmbhbuk63NiYSw4MT8e/hMw0VIYuUb2XcK1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731667744; 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=4CA9HjNJOAXrT3UeOfqfEgk/0cPfKtrlO3sexfMjoZo=; b=fBhx3Yz7Be0sCgRHnGvnHbxW6FfFWnrNBIwmKs+I5ief9SnKllRjFAQ8hWVxe188ncAH6t FabkCnHt7JRmtHYAQfFZi7Px728rGcnkfQ13SeK3RT5uQoOqjBVlGXU2/+mZ9FMcRXIezQ dBZ2rbh7wxe8DpxOFHmq+5Xd/m/TKxFDqC+Fi/cztz7Awa8t0HwRMaeiUfZPKbu4ku9Xlg GKJy1jGIfZeDxThrhoNHcvWudrFhZHUJzXvWiGN6naijnoCMlsiORkjbBlAbPSvc8AbqCu su85aRiJ8rvyA0BHVYkeEUN3QYv8eglensyWFhuB15St1PVGphDEqkmHZTM8Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731667744; a=rsa-sha256; cv=none; b=FHsLGuvD7qTGEQEhOq5P7pof6wdaIJGbCEzE54YLHEMn3WsRhlqj2jFN9T2GMSWNU1wwiC EjTiosGzVDpP+bIM49P+mv2SfgW7EvnfY/bd97qltLzuEOmmOwUoZCt596WMECIz22q70b SKK84k+PoS/W2ycVbQfnDZFKWTAIwe/0DFqeRd/DILe4METB9eTNWvg33yOeG3yK9pGwmD gMb71HXk2SIjbICT/e0Ht/Q/bkJFpW2v5hJtLeSe3snlTDVNGBDnI19HDR43jo0sCkn5Kl kDWnwJw6S9ObiCPXwi4iuY7CJaZGwJ7EDw4c0vnRRH7R8YbxyWgMWKd7Kq0ltQ== 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 4XqYfm4yK3zKQt; Fri, 15 Nov 2024 10:49: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 4AFAn4RG018278; Fri, 15 Nov 2024 10:49:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AFAn4B1018275; Fri, 15 Nov 2024 10:49:04 GMT (envelope-from git) Date: Fri, 15 Nov 2024 10:49:04 GMT Message-Id: <202411151049.4AFAn4B1018275@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: 6cd8d025282f - stable/14 - cred: groupmember(): Remove tolerance for empty 'cr_groups' 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/14 X-Git-Reftype: branch X-Git-Commit: 6cd8d025282f8c30e5db74806f7e94630ce57d8b Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6cd8d025282f8c30e5db74806f7e94630ce57d8b commit 6cd8d025282f8c30e5db74806f7e94630ce57d8b Author: Olivier Certner AuthorDate: 2024-11-01 16:12:15 +0000 Commit: Olivier Certner CommitDate: 2024-11-15 10:47:43 +0000 cred: groupmember(): Remove tolerance for empty 'cr_groups' This tolerance had been introduced in commit caa309c8811d ("nfsd: Fix handling of credentials with cr_ngroups == 0", on 2024/10/21). Now that NFS has been modified in the previous commit (cfbe7a62dc62, "nfs, rpc: Ensure kernel credentials have at least one group") to rule out credentials with empty 'cr_groups' (and thus, no 'cr_gid'), remove it back. This basically reverts the above-mentioned commit except for the not directly related modifications it contains, which are still valid. Discussed with: rmacklem (by mail) Approved by: markj (mentor) MFC after: 3 days (cherry picked from commit 3f313682e030f1c99d9b223093e84d0a53a109af) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index db07c265dc13..60452ddb6a48 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1377,13 +1377,6 @@ bool groupmember(gid_t gid, const struct ucred *cred) { - /* - * The nfsd server can use a credential with zero groups in it - * when certain mapped export credentials are specified via exports(5). - */ - if (cred->cr_ngroups == 0) - return (false); - groups_check_positive_len(cred->cr_ngroups); if (gid == cred->cr_groups[0])