From nobody Thu Sep 28 15:10:36 2023 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 4RxH3c5ZGdz4tv1L; Thu, 28 Sep 2023 15:10:36 +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 4RxH3c50FWz3XhH; Thu, 28 Sep 2023 15:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695913836; 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=ufTOl4pZ/X0MAr96KClR8k77SnKsFPAJ8oENLAHYghY=; b=PvIzHNSrIFJIaMDEUXya0hGyDXOzff+5yecBhFkH51iLqdFLupIPycSwx01ADqLIbDKaFT pFyfxZYPqK4IgL6R0ixG/mjP+B0zsfaXWetFuiIlowVJO7b6s1opaPKXJ2RN4ehCJIqiod MHH4Es5BltMpEW2DPL6oXeQDuyaZNoJQHWUH4wTB2ibphwY/bpowEjxjqC9PsKx0Tkl+eg IOPlhGSLdJhrca/R3ToIkpxDb28U8T12MjTLzU+KN35I69So2jaiMycCBM1cPV5HU8aCT1 i7j2ML6yuN3tOn6dqG82E370Q9QVvGg94Vw63uSsnrZiVPD7oHa7XmHNuQ0KYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695913836; a=rsa-sha256; cv=none; b=pHMjdi08U1WdoCHxyIx+pHyrBRskI0Iw/dUYD0wrSdPrHUbLxo5WIEYa+B85AacTUgmhAa d9PAktgXZpkn/SkSou78/o11Nwi75J/WlekH1nGsS71r6770rj/9HOR1QOkr/tbiwp1SxB LoqY+woB9+f5ANWpHe3y19jNL2jWm5WCQ+sgqateb4Co1aZl5FnrLb39Uw9SbCvohZiA2q yGCnXakLRzWLRKUSTIs/m+iJcLf3NiwYuKD0IAh4/SJAbKNUxB5Uw+phMDuChvkuh/ELuS Z+xeeANqZRyKxT1lLy3uPs/EW8A5ZIQx2hgYNlOdOgjmrpM/LcsRAaBKRGb+Aw== 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=1695913836; 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=ufTOl4pZ/X0MAr96KClR8k77SnKsFPAJ8oENLAHYghY=; b=hQpMTH0nF0gKBHQz5lhBPFXLaw5k2Qm7y9m3HsX7G73cAbG2G6TKdAdQ9wr+N/arhr0jyP jjMB1bD3k6S3VLvLVrkzmlP0BhAroy/8srdACcxCkaCxmNOOnFGb6+4zXH0BEhKTe76ZXb nMomaqtp8+Ovtb5HkkS91BItGQVKy/gXvzDKv/e7p8QHldW35vIPSKx1oSEheMXpPshBkp cAKEdcBFr8DDpLuKM5nNTC+kRqzpQFrvjqD/96IGcNaOpbZeGWkHWjPrNE4sWOCO1OwEzy hy7K6OcujOLJNMcW9+IjzCXbz6nCy97/dy9KfxBhFf73qcxR6NBBEE0WIU393Q== 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 4RxH3c3pDQzBjk; Thu, 28 Sep 2023 15:10:36 +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 38SFAarr047251; Thu, 28 Sep 2023 15:10:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38SFAaV7047248; Thu, 28 Sep 2023 15:10:36 GMT (envelope-from git) Date: Thu, 28 Sep 2023 15:10:36 GMT Message-Id: <202309281510.38SFAaV7047248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 91e9d669b475 - main - Make cr_bsd_visible()'s sub-functions internal 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 91e9d669b475d1900e8dc01a49ad90a621c4a068 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=91e9d669b475d1900e8dc01a49ad90a621c4a068 commit 91e9d669b475d1900e8dc01a49ad90a621c4a068 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:39 +0000 Commit: Mitchell Horne CommitDate: 2023-09-28 15:05:45 +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. Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40629 --- 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 648c067dc528..04aaebf0de63 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; @@ -1351,7 +1355,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) { @@ -1381,7 +1385,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) { int i, match; @@ -1423,7 +1427,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);