From nobody Thu Feb 02 00:03:25 2023 X-Original-To: dev-commits-src-all@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 4P6fBj6l1nz3cQ13; Thu, 2 Feb 2023 00:03:25 +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 4P6fBj6HKfz3k23; Thu, 2 Feb 2023 00:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675296205; 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=K8cawiDNUUwmcDQHfvdEg16McDR10f2NgJmeGoeMCaU=; b=FCv1AYW3/w3X+mpDd/APTMDfI9TLns8AeOFFGIyq8gPAl2A5GML1y+ZLKH5q3AfjYyIawB WCYcJL31S7fpn/B3kF7oVq181VKURECPuLZpt9vUUedEkPttK+twlc2M4ZJxG30n1eelPL 73+G15LSwEJ8F1vVWElGtDRttmzDljt7fNlutCktzxUJkv3nbr93u2D+f4zrcFZhWeATx8 CiTYUNMZcmelWwX0FZ3OGC7VDvJ5JFiKhD/QTIs8rnlWn9+hUAK9zPpzxY0pXd+3ZQ0Cw5 gfGHFpj9+0sAXDUggK9Tlf3j4yeTG070vPvMGcvOiGilOoDyZ81ctTJ5989r+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675296205; 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=K8cawiDNUUwmcDQHfvdEg16McDR10f2NgJmeGoeMCaU=; b=cF9c3ouZVhxwHcCQcR0ys1R0612Q9sjdBmchGOsOMWuHiWXH8TV+Tqzwv4gHiNySmKU9we JZDQVWmjrVbSza7yaRfHfscnKAv5nyC/5elDHPvYwnVvH/6dKQG/iSVMa2jMo+lpQT3mCe xcdQ3i9J8Z9ETnV7fD0t1URj67X2QWs5VhIAZ1Gmu7sjuvjnImUouM8x/DJR7N3uuODLfw lFI6FJxnU+ZDujPr1IcDesQwRniKnsg/v+Ga/B0sJMijsPNNnN2Tgyr1tLi1ctriihtuD+ WgEYImaSQZbEvE2T2LpW8zxuhzA369q1OdEduEjsjPn1pycYgX8/0XBDezcMpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675296205; a=rsa-sha256; cv=none; b=nf0z1ezdaKeFIuRPdzfLk26RoY/HhxIzbTAgL1K0FuE5ZytjOLm88LxeEce+aXJcPrCy36 KPzeiEk0icykGoq/6sXvA/wejOQt/9Z6byzfLbkH2WSWuPxToev2tLKRCwGedUmiuRw8lJ MswaJi/RtI3SJVSKmir/hQc5wWWSfxv7VVr3xTIAA5pBLP5yVUmRSue1i0mC57s0kZPZ+I Wj2Vv3ZkyKnMK628HSXc1Gg5XVye/L3icRE4yyz/8ttuKZVfTdGdowUg+66e58PCovs23k GP5dXGZzZAQwm4ss5RyYs/50jYLW7I9t+xLxEDGpKEwUS72jAW0uilwHq7LVUg== 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 4P6fBj5NCMzZ1X; Thu, 2 Feb 2023 00:03:25 +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 31203PqP020221; Thu, 2 Feb 2023 00:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31203P9g020220; Thu, 2 Feb 2023 00:03:25 GMT (envelope-from git) Date: Thu, 2 Feb 2023 00:03:25 GMT Message-Id: <202302020003.31203P9g020220@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: 99187c3a44c2 - main - prison_check_nfsd: Add check for enforce_statfs != 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 99187c3a44c2c3e168e462a30d45af075748195f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=99187c3a44c2c3e168e462a30d45af075748195f commit 99187c3a44c2c3e168e462a30d45af075748195f Author: Rick Macklem AuthorDate: 2023-02-02 00:02:20 +0000 Commit: Rick Macklem CommitDate: 2023-02-02 00:02:20 +0000 prison_check_nfsd: Add check for enforce_statfs != 0 Since mountd(8) will not be able to do exports when running in a vnet prison if enforce_statfs is set to 0, add a check for this to prison_check_nfsd(). Reviewed by: jamie, markj MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D38189 --- sys/kern/kern_jail.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 0820de9d5ac0..4c1e3ff40c58 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3491,6 +3491,8 @@ prison_check(struct ucred *cred1, struct ucred *cred2) * - The root directory (pr_root) of the prison must be * a file system mount point, so the mountd can hang * export information on it. + * - The prison's enforce_statfs cannot be 0, so that + * mountd(8) can do exports. */ bool prison_check_nfsd(struct ucred *cred) @@ -3502,6 +3504,8 @@ prison_check_nfsd(struct ucred *cred) return (false); if ((cred->cr_prison->pr_root->v_vflag & VV_ROOT) == 0) return (false); + if (cred->cr_prison->pr_enforce_statfs == 0) + return (false); return (true); }