From nobody Wed Jul 10 23:22:00 2024 X-Original-To: freebsd-stable@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 4WKDVM4ykVz5RMLn for ; Wed, 10 Jul 2024 23:25:15 +0000 (UTC) (envelope-from naddy@mips.inka.de) Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WKDVL5GYRz4SZB for ; Wed, 10 Jul 2024 23:25:14 +0000 (UTC) (envelope-from naddy@mips.inka.de) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of naddy@mips.inka.de designates 2a04:c9c7:0:1073:217:a4ff:fe3b:e77c as permitted sender) smtp.mailfrom=naddy@mips.inka.de Received: from mips.inka.de (naddy@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1sRggK-003exT-Fe; Thu, 11 Jul 2024 01:25:04 +0200 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.18.1/8.18.1) with ESMTP id 46ANM0VS007882 for ; Thu, 11 Jul 2024 01:22:00 +0200 (CEST) (envelope-from naddy@lorvorc.mips.inka.de) Received: (from naddy@localhost) by lorvorc.mips.inka.de (8.18.1/8.18.1/Submit) id 46ANM03g007881 for freebsd-stable@freebsd.org; Thu, 11 Jul 2024 01:22:00 +0200 (CEST) (envelope-from naddy) Date: Thu, 11 Jul 2024 01:22:00 +0200 From: Christian Weisgerber To: freebsd-stable@freebsd.org Subject: mac_do: gid rule fails Message-ID: List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-stable@freebsd.org Sender: owner-freebsd-stable@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.76 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.46)[-0.456]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:202113, ipnet:2a04:c9c7::/32, country:DE]; MIME_TRACE(0.00)[0:+]; FREEFALL_USER(0.00)[naddy]; MISSING_XM_UA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; MLMMJ_DEST(0.00)[freebsd-stable@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[inka.de]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4WKDVL5GYRz4SZB I noticed that mac_do(4) and mdo(1) were recently added to 14-STABLE and decided to give them a try. A UID-based rule works: $ sysctl security.mac.do security.mac.do.rules: uid=1000:any security.mac.do.enabled: 1 $ id -u 1000 $ mdo id uid=0(root) gid=0(wheel) groups=0(wheel),5(operator) However, a GID rule fails: $ sysctl security.mac.do.rules security.mac.do.rules: gid=1000:any $ id -g 1000 $ mdo id mdo: failed to call setuid: Operation not permitted Is that a misunderstanding on my part, am I doing something wrong, or is there a bug? 14.1-STABLE as of e729e750806d3873d5de24cce3b47cc054145985. -- Christian "naddy" Weisgerber naddy@mips.inka.de