From nobody Wed Oct 18 18:04:03 2023 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 4S9dyW4CBqz4xL8S; Wed, 18 Oct 2023 18:04:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S9dyW23Drz4Y5h; Wed, 18 Oct 2023 18:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697652243; 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=EOUuaJqnOtI36tgmtwO8UDoZt9ar123t1mkyoQePzOk=; b=UJqiaLiTHDOezPTYpuljmDuyOsufH9F9O6P7GtNaSHo2z2ovSVEfZ3Zq71/61/IlQwT3O7 jA+oUC53aoELQ+vs3bjlXCr5CR22U/Zxi8QFNZD86nr+NRVzG1lJbU4akfvlN4YfTsJO8r Jr5jevqai+u5iLKxaFSVjG3y5LlCHLvPSdLxGgNCQzCB3FufRGickkW5dr7XKGLVoflM0t swLhYBeINdjttuNO6vayO+gvOxXJenODHmN21alHcYdWR1F5oUJ+HxQ2Iq6Z4dyS7XTz4K MCRSc5f5u4Ds+BIAQE0iO8qEwkPqCbHXIineWpHedvtMtois99aSqXZGHGX9Hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697652243; a=rsa-sha256; cv=none; b=dhnwIYXoGVXc/DLym+VaXn4iQ5cDbyIIV/0fM30CTAirVLougx2N6zHMdTVHpYdGEeIMbq Bh54rYe0MBsf3lgPeZxkAvnsaDkdy87qZB3x/1IZKHSvi7GGgjyjn+bYv44O2XM7gJ6mi3 oSuwH+jrxNPQ0E0d0J8vIIxgLYmuvsHMEWZFYbObIFbzLx7rCKFumwmRkXb6bBqKq+NTTl a6ZQ6wr3J4LxJe1eBCiB42ohKGNluAtYSpKUxzxnKV90J51OScuV74TzydF5gSsVgjW2FI Q5KDAfuTZO6gcYZRLorIidHm230+4FX4YVsDS9UYwvHE74+4H5jzQugDfnR5mQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697652243; 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=EOUuaJqnOtI36tgmtwO8UDoZt9ar123t1mkyoQePzOk=; b=w/yvcMii19AvJCZ1Dh7/TMrK9k6p9dticuWZEMFs03CJNvXGHRs7pqYSF5vj9g8wRaYlhb BtNSc0+IuwrsLe+Skqa53yOUXlBElMDwsMEJJGrYK64cMy9U6XKQyqqA1msp4CZrb3uSaw qgqqlfPzHyTmJuWro6Fbt2n1vNpRlnSesjtUOSmTgvglsLEs7Dyol2674OCFZqY1KXoTfi iP+pHvN7nPm5n48L66tD0F4wS9WeCmjlVNXHt5shNwV7GQ1H4xwEy/j3RW4QjB4uBaogIi DhJeHn4JLTWFmwjHOzvopJWazBv8MU0XsiLybhlK5HrUsVrZmUy/qA4emhWsJA== 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 4S9dyW19B6z2Rx; Wed, 18 Oct 2023 18:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39II430d045260; Wed, 18 Oct 2023 18:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39II43VY045257; Wed, 18 Oct 2023 18:04:03 GMT (envelope-from git) Date: Wed, 18 Oct 2023 18:04:03 GMT Message-Id: <202310181804.39II43VY045257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 3b14e215dd68 - releng/14.0 - Make cr_bsd_visible()'s sub-functions internal 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 3b14e215dd6805544afeb336352e8724b0ceff51 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3b14e215dd6805544afeb336352e8724b0ceff51 commit 3b14e215dd6805544afeb336352e8724b0ceff51 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:39 +0000 Commit: Mitchell Horne CommitDate: 2023-10-18 18:02:25 +0000 Make cr_bsd_visible()'s sub-functions internal cr_canseeotheruids(), cr_canseeothergids() and cr_canseejailproc() should not be used directly now. cr_bsd_visible() has to be called instead. Approved by: re (gjb) Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40629 (cherry picked from commit 91e9d669b475d1900e8dc01a49ad90a621c4a068) (cherry picked from commit 07c60e63237e1d4657cfbd6b03116c4913827e8c) --- sys/kern/kern_prot.c | 10 +++++++--- sys/sys/proc.h | 3 --- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 14b19837d5dc..00eb2fccdeef 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -91,6 +91,10 @@ static void crfree_final(struct ucred *cr); static void crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups); +static int cr_canseeotheruids(struct ucred *u1, struct ucred *u2); +static int cr_canseeothergids(struct ucred *u1, struct ucred *u2); +static int cr_canseejailproc(struct ucred *u1, struct ucred *u2); + #ifndef _SYS_SYSPROTO_H_ struct getpid_args { int dummy; @@ -1371,7 +1375,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_other_uids, CTLFLAG_RW, * References: *u1 and *u2 must not change during the call * u1 may equal u2, in which case only one reference is required */ -int +static int cr_canseeotheruids(struct ucred *u1, struct ucred *u2) { @@ -1401,7 +1405,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_other_gids, CTLFLAG_RW, * References: *u1 and *u2 must not change during the call * u1 may equal u2, in which case only one reference is required */ -int +static int cr_canseeothergids(struct ucred *u1, struct ucred *u2) { if (!see_other_gids) { @@ -1440,7 +1444,7 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_jail_proc, CTLFLAG_RW, * References: *u1 and *u2 must not change during the call * u1 may equal u2, in which case only one reference is required */ -int +static int cr_canseejailproc(struct ucred *u1, struct ucred *u2) { if (see_jail_proc || /* Policy deactivated. */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 8609bbd124ad..0b91b2a1a0b5 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1166,9 +1166,6 @@ struct thread *choosethread(void); int cr_bsd_visible(struct ucred *u1, struct ucred *u2); int cr_cansee(struct ucred *u1, struct ucred *u2); int cr_canseesocket(struct ucred *cred, struct socket *so); -int cr_canseeothergids(struct ucred *u1, struct ucred *u2); -int cr_canseeotheruids(struct ucred *u1, struct ucred *u2); -int cr_canseejailproc(struct ucred *u1, struct ucred *u2); int cr_cansignal(struct ucred *cred, struct proc *proc, int signum); int enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess);