From nobody Fri May 19 21:36:13 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 4QNKsT59MNz4CPwL; Fri, 19 May 2023 21:36:13 +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 4QNKsT4LbQz3jjK; Fri, 19 May 2023 21:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684532173; 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=jRxGbkYbo3dhOMCj3iwHpCHxLq9p//miscQN0wCosCc=; b=fFdL04iTSHd8dflTe6gsX9muYWiqMc11d2ElmG+zkNIuseCkTBVbTb0kDl/Iudt/Nnqx1f LSLnaM4V2WCunSt4mkwZUWyE0SWvmCTjuTREwcbZWFhMGzqZl+ajtKoWpdBYznDI90848g 6cID/RuUHz3b6wLNkMcil1dbOofchH+NPd7Z9bxB90v+2b/PD+1aveH0qm0QEp4UZmnNDB wQVTFPUU4M+OgCP88rJXMUX+hNE2zyo5tFIobkXhW3HwvWH+JZeb98Xq8MiDp0HGO/KDP6 JxXfMV1qdQhTye9srNt72pUYAIK2zXikLaAGh83W7PWjFwmGOn1fBw7wdpabLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684532173; 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=jRxGbkYbo3dhOMCj3iwHpCHxLq9p//miscQN0wCosCc=; b=Qc902dAcyxfkX32Uzr2dPBl2+rjheo2AwjpvXBscsyeXnHf7cX2gjHov5yy/L0BEmPHvNY RZOLaOV/bbn3PwDog9wkVmwmJXKfE+QXatkXd3zW+2JgBkfJiPxAnCJ/CB8pqxbVOtAZFw g1o8g4mjb27Oglg8UDklnGRa4M6M2kVJb9pkHCzn0/bdcYrgHHhqdcQWyzJMqy9POVBoIe ZWsOaLjDjjAxYq9SunvQahBAS3GSF5owooieebAq76Dty9MYu4ipP/Z4Emp3ZBX20KgdLY IKylxooZybY2QjP+qrWIx40k+bwK4KaVID5kBcBt2N4BavJJ4Us1bAWyk97YpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684532173; a=rsa-sha256; cv=none; b=QbAJg/ihG8H5BxKX28IFhd6uYM3EawAvGl9bZ2u+r5IVc+dlesUVAkQayEkBTKQ0vt75wU 6Y2nCCS8NFtoe7CLUOSXPGbWQWFL/x6yjuBFb1Mp6BAkHlec0lqMGhZdBnAFHnnt5h8J3X iwGp9BANjZTeOzK4Xis5hN3ei+/mB1F2oJJjN3e/Mu1UCLNMwMk/xGRaA00NcHUKR56rKF uyRva1CsPY0rgnflhCmcyYGwaE6Ba1bCHuZy2T0gjQtLFm99IuQh4bEqKUxcr8PS74wIq7 qb7aVkDLkDF8r/9a9o1070G4H31WbDHsnQF5lW9G8CqRbEH403s0V3JRjw8zCg== 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 4QNKsT3N4FzkT5; Fri, 19 May 2023 21:36:13 +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 34JLaDcs033895; Fri, 19 May 2023 21:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34JLaDNm033894; Fri, 19 May 2023 21:36:13 GMT (envelope-from git) Date: Fri, 19 May 2023 21:36:13 GMT Message-Id: <202305192136.34JLaDNm033894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 544ebd2a9806 - stable/13 - Revert "kern_jail.c: Remove #ifdefs for VNET_NFSD" 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 544ebd2a9806f55aff9b33f8c17d3237c81b41d3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=544ebd2a9806f55aff9b33f8c17d3237c81b41d3 commit 544ebd2a9806f55aff9b33f8c17d3237c81b41d3 Author: Rick Macklem AuthorDate: 2023-05-19 21:34:58 +0000 Commit: Rick Macklem CommitDate: 2023-05-19 21:34:58 +0000 Revert "kern_jail.c: Remove #ifdefs for VNET_NFSD" Revert this commit until I can figure out build issue. This reverts commit eb6588af1585f4c2d7a1a4df6bae164bd6a063a6. --- sys/kern/kern_jail.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index d43d2326cfec..0203dcd0faf1 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -216,7 +216,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}, -#ifdef VIMAGE +#if defined(VNET_NFSD) && defined(VIMAGE) && defined(NFSD) {"allow.nfsd", "allow.nonfsd", PR_ALLOW_NFSD}, #endif }; @@ -1888,10 +1888,12 @@ 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; @@ -3471,7 +3473,12 @@ 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: @@ -4223,7 +4230,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"); -#ifdef VIMAGE +#if defined(VNET_NFSD) && defined(VIMAGE) && defined(NFSD) SYSCTL_JAIL_PARAM(_allow, nfsd, CTLTYPE_INT | CTLFLAG_RW, "B", "Mountd/nfsd may run in the jail"); #endif