From nobody Thu Mar 02 21:14:58 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 4PSP4y3Fc5z3wGx5; Thu, 2 Mar 2023 21:14:58 +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 4PSP4y2jN4z40jv; Thu, 2 Mar 2023 21:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677791698; 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=sHEckn+4lAxc+6JQNj5sEHyL7KUvAnZCQII1uKzs1Tk=; b=NS5KZJDwyM0Hkwv3qr9UIr8edTAJdFTkj710a+ZG8qU8ABwAA7HfPvN43LsqtngIYjNDFs 5JFMhpgBMKbvsmGXPcfNz1HoIJq15Y3Szuj1Yt2es5z2bwyF89ioGv1Oi6YVUZyvGrvx3S ju+b3mGW9ikqmKE3+1mZ3LE/thDQExgj8BpKaJIH42cFNcF3x4FrSVVjF1aljZKo4Ce4Qq eWv9ANYXlPBW9p0HJ+rsgSnLcx/j0AvuVCpI/SQUi1iFIJgpIKilbBMCtaPgNevDqu1Oam 0bEAcE+6Jv4iWlfiREyJ/pbOLEBQBa7wmEo1AKdFyR/YzWjU/VauQp501ts+Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677791698; 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=sHEckn+4lAxc+6JQNj5sEHyL7KUvAnZCQII1uKzs1Tk=; b=sd5diYa/dA+M9UH64XgkWJm9FVgGfH70y59fKx6LrlQDy2vPJoCeTU+2twck/vv5QMvbju j1PTMKIfugEVlb3jmuzL6/gB+WvW9Eipjm+xpeIVJRIJPJ1OqsM6cb4dkDL+dCLr8CM0qv G5ZL152ml8GqGW/PDS/lSQzuP5Nq/PqYBrlmcJtDfSydLg+FfUky5kgYk3AsFQ/knnHNAz oB0xMW77UpE4YOwoglz4+A+3nVSXcwCtQZngULVI75qjWs9lfyHscVo0cdQho9oVEMxG4z 1hgODCR74D+JgWKsVbUKfv5bJFFcAsBSW8rC0Nfvt6JKT6HydeJm4VrEr6NBSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677791698; a=rsa-sha256; cv=none; b=HWtjN9NhYWaELlWpvFYHF9tt9abrUATVew6kzMjaWooM/sjIZGt4p/am/xCH2GJb2RjkV6 CZHZnwZ0sO2n+Z6A4KNs/jyWVd4KtlTJX/76KghjRfl49qEKmRclyu9PaPP/IJOHj9ahiD wYdcOXj7vAWxWaKoqY4szn8JwYqVNreFSK98Yw1XZ4Ko0YyzpNA5mNVrmyZDq0ov1RALrl BO+1O55KZgignrfSrHTBoTtzcKjo58U/vqvplR8RmSFM60U2G0QKtKPXNcALAcEAOYV1lI NReowEORZlsmK0wGDxlvXNF2GjHYrIia1NlIF2kRSoruYcvWUVz4BgArhtZCJw== 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 4PSP4y1mtWzWpY; Thu, 2 Mar 2023 21:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 322LEw5x032134; Thu, 2 Mar 2023 21:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 322LEwf7032132; Thu, 2 Mar 2023 21:14:58 GMT (envelope-from git) Date: Thu, 2 Mar 2023 21:14:58 GMT Message-Id: <202303022114.322LEwf7032132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: cbbb22031f9b - main - kern_jail.c: Remove #ifdefs for VNET_NFSD 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbbb22031f9b957967c03dc8e685392f7d7e7fb8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=cbbb22031f9b957967c03dc8e685392f7d7e7fb8 commit cbbb22031f9b957967c03dc8e685392f7d7e7fb8 Author: Rick Macklem AuthorDate: 2023-03-02 21:13:24 +0000 Commit: Rick Macklem CommitDate: 2023-03-02 21:13:24 +0000 kern_jail.c: Remove #ifdefs for VNET_NFSD The consensus was that VNET_NFSD was not needed. This patch removes it from kern_jail.c. With this patch, support for the "allow.nfsd" jail parameter is enabled in the kernel for kernels built with "options VIMAGE". Reviewed by: markj MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D38808 --- sys/kern/kern_jail.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 41bd5cdca620..72d89a290269 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -219,7 +219,7 @@ static struct bool_flags pr_flag_allow[NBBY * NBPW] = { {"allow.unprivileged_proc_debug", "allow.nounprivileged_proc_debug", PR_ALLOW_UNPRIV_DEBUG}, {"allow.suser", "allow.nosuser", PR_ALLOW_SUSER}, -#if defined(VNET_NFSD) && defined(VIMAGE) && defined(NFSD) +#ifdef VIMAGE {"allow.nfsd", "allow.nonfsd", PR_ALLOW_NFSD}, #endif }; @@ -2136,12 +2136,10 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) } #endif -#ifdef VNET_NFSD if (born && pr != &prison0 && (pr->pr_allow & PR_ALLOW_NFSD) != 0 && (pr->pr_root->v_vflag & VV_ROOT) == 0) printf("Warning jail jid=%d: mountd/nfsd requires a separate" " file system\n", pr->pr_id); -#endif drflags &= ~PD_KILL; td->td_retval[0] = pr->pr_id; @@ -3790,12 +3788,7 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_NFS_DAEMON: case PRIV_VFS_GETFH: case PRIV_VFS_MOUNT_EXPORTED: -#ifdef VNET_NFSD if (!prison_check_nfsd(cred)) -#else - printf("running nfsd in a prison requires a kernel " - "built with ''options VNET_NFSD''\n"); -#endif return (EPERM); #ifdef notyet case PRIV_NFS_LOCKD: @@ -4551,7 +4544,7 @@ SYSCTL_JAIL_PARAM(_allow, unprivileged_proc_debug, CTLTYPE_INT | CTLFLAG_RW, "B", "Unprivileged processes may use process debugging facilities"); SYSCTL_JAIL_PARAM(_allow, suser, CTLTYPE_INT | CTLFLAG_RW, "B", "Processes in jail with uid 0 have privilege"); -#if defined(VNET_NFSD) && defined(VIMAGE) && defined(NFSD) +#ifdef VIMAGE SYSCTL_JAIL_PARAM(_allow, nfsd, CTLTYPE_INT | CTLFLAG_RW, "B", "Mountd/nfsd may run in the jail"); #endif