From nobody Sat Nov 02 20:39:38 2024 X-Original-To: dev-commits-src-main@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 4XgqNC0xkrz5ch9D; Sat, 02 Nov 2024 20:39:39 +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 4XgqNB5QvRz44bS; Sat, 2 Nov 2024 20:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579978; 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=FYxlfPbSjZGriHIH5i35QbjKguHqfyMp0Zy6XqwPhvA=; b=m75tt6EMZOcSUXvZRgvo4D/2AytDZSHvNmeTtwG40krRyNsLAyATEnG/QYVxrjJ91Lhf1g dOOpJsWqCIWQpvdVojMxqtuElNieeNiFEjnatPx5HDQgmi1S0vFqO8yuQc48xCzSZ2PSi0 hKc1kIKLfbYvgOIwuERc8g3DCWa+MBJfhGb01EQ9wg48SHewEdUQVF0uw9YyfKrhk0JD10 /RNy4offBb0hxZwZZ6EktZ7Ir//XgY+OLGdNUX0BPgn7ft6qZ8hk6YcwolTgr1tPObHVAi fSenIzShpiQEt68NNJmulwj9f/2MW3dKRZvBzLbHb9OEmptUwEQNGTtYy6MsWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730579978; 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=FYxlfPbSjZGriHIH5i35QbjKguHqfyMp0Zy6XqwPhvA=; b=YyD0WLUnpI9vArVZlLENZlM8zpgjeDijPdcePiKl52yDxkawSrbJrBbFNzJVKzenVxOL5v 92U1V2XoK7YL7NPRpfUgb+iMuH+N35qpJNpG5xb7fSj+0ZPLkJPWhC7Sx9dtKloqUMjr5L YUVMliB70cORybjYCgb1fkrb1JAFyb8xV/6F8i1LTKLkr3Zv/l87rOeHY01pmvaJW241oH utduBw/evG2TmJNfHLpAJOPcSNcbCWlLh7goNSYZIJQq6YBpOvYWdaFFo1bU8xlGX04YEv oz0KFLWsB7LtniYUGbo6xbFM92np3Fk/MMV6ntnyTByq7SqKw8fGHL4AiAvAPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730579978; a=rsa-sha256; cv=none; b=cZ0NMaimvUqlPVfWaR19aOS/5xGfu6q2hqdfLg2/mQRBSYuJIv+mm9e8xZQ2SDgyNRMYn+ C4tsEF3oS0OkZLDnMCFe08OXpwb0lPyEx8EjLV/GL0idleEDjAiT3IwG/cCt5VJprT+Bto zRCsU9FyuNmf0gXAfPByGzaevXxifOEwPjwGvw3uERYhCXuOU4PvVyp8bOLQAB/xaN3xuK mSBmkMIGgx1hEBQIdL3Dr/lX9I41ZXw51wvTUz/I9G3hRucbGnAxQnzXTc9toU216gQLgS KYIuIf83qee53j5g0tMIimG8l1CVZEMZdZNNWzzQXnSYakNQQhKX6AKn2KHM2A== 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 4XgqNB50FMzKFD; Sat, 2 Nov 2024 20:39:38 +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 4A2KdcWt046631; Sat, 2 Nov 2024 20:39:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2Kdc28046628; Sat, 2 Nov 2024 20:39:38 GMT (envelope-from git) Date: Sat, 2 Nov 2024 20:39:38 GMT Message-Id: <202411022039.4A2Kdc28046628@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: 3f313682e030 - main - cred: groupmember(): Remove tolerance for empty 'cr_groups' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3f313682e030f1c99d9b223093e84d0a53a109af Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3f313682e030f1c99d9b223093e84d0a53a109af commit 3f313682e030f1c99d9b223093e84d0a53a109af Author: Olivier Certner AuthorDate: 2024-11-01 16:12:15 +0000 Commit: Olivier Certner CommitDate: 2024-11-02 20:38:21 +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 --- 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 504c79313408..b522edbf4e69 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])