From patchwork Tue May 14 20:41:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 10943725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06C5B1398 for ; Tue, 14 May 2019 20:45:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E940D28985 for ; Tue, 14 May 2019 20:45:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA8E12892A; Tue, 14 May 2019 20:45:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8DEC2892A for ; Tue, 14 May 2019 20:45:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbfENUpX (ORCPT ); Tue, 14 May 2019 16:45:23 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:34888 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbfENUpW (ORCPT ); Tue, 14 May 2019 16:45:22 -0400 Received: by mail-it1-f195.google.com with SMTP id u186so1051385ith.0 for ; Tue, 14 May 2019 13:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3ufsLM6u7rIENRihY2pJS2ohWHx5EjKSvPGEo5obMww=; b=nOxf6WhNbLoccNi1gNRHPfIW1ihPfOAMy0cTLoGEebO6eipQzISZfZBxL99eaT/qaq 4xjvAbuE/NlfCXjlFtl0TfZi3Yn8FXJ+mM+d2oK5JGW9mjQaZtkjVCpAqbgn5F9MlaMC Gbcxr1x85AX3EMy8shDTGcSrdJoXQQBCBnvibgOw+BXeBDzIaTFmyTqYsaPvl8aR4jBB yqtA/fw0E5ErhnuTPUpE4Nc2yORq+FwXYMaxbzwUjUFa1DFY1B5lzdIQbs7K6TxwboVk uZSNMTDsS+M9uMjzIsLZVzm8Gw/lZuheG7+clWw64icCfV4nE5CNMiuJ9xSjKLtHZeND qVLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3ufsLM6u7rIENRihY2pJS2ohWHx5EjKSvPGEo5obMww=; b=Ze/2EdLdhi77E0BQqz9WoFqCF3qCIRzorpOWLuzE7IaDB/NzUdQwspgShyoe08Me9J 5K5I7O0cUt9/qMytdKTlqXwVoBsZaPvQceM6wEZdeROt2mAOSNGkdhN3h8h79Y4o6k1w mIBCoCVMJMudaL5VHh3M31Q+nU6TP1QbKOl7seOYtQXGcxoCgsNAWo9EEnHD2mfcykxE CqNaniDan7Tvpw+0hUcV2on7191j9vPUklI34xTD86eRnQxFtvSmL/kiiVhVrFiciOzu tO97SluXCxZj7vOImO9+ilK1eVpUxlIAjrTnOiOGC/dNuHvdwQy0rNtvZhghJAd+DDum 78zg== X-Gm-Message-State: APjAAAWr6LwCn/srBEG7SQOPWRa7SNgMIEvOU688v+uT5lZcJIN/iJES UiSoy6nxdWtzfUcAx/yHosgJ06s= X-Google-Smtp-Source: APXvYqyA7dzRRTyoB39WbNg6fPnlr4vfcDLB3BY97qvZ7BxUKEba8qn8NKEk49shsJygXeqoK3ccXw== X-Received: by 2002:a05:660c:444:: with SMTP id d4mr5668154itl.158.1557866721682; Tue, 14 May 2019 13:45:21 -0700 (PDT) Received: from localhost.localdomain ([172.56.10.94]) by smtp.gmail.com with ESMTPSA id r139sm64943ita.22.2019.05.14.13.45.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 13:45:20 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [RFC PATCH 0/5] Add a chroot option to nfs.conf Date: Tue, 14 May 2019 16:41:48 -0400 Message-Id: <20190514204153.79603-1-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The following patchset aims to allow the configuration of a 'chroot jail' to rpc.nfsd, and allowing us to export a filesystem /foo (and possibly subtrees) as '/'. Trond Myklebust (5): mountd: Ensure we don't share cache file descriptors among processes. Add a simple workqueue mechanism Add a helper to write to a file through the chrooted thread Add support for chrooted exports Add support for chroot in exportfs aclocal/libpthread.m4 | 13 +- configure.ac | 6 +- nfs.conf | 1 + support/include/misc.h | 11 ++ support/misc/Makefile.am | 2 +- support/misc/workqueue.c | 267 +++++++++++++++++++++++++++++++++++++ systemd/nfs.conf.man | 3 +- utils/exportfs/Makefile.am | 2 +- utils/exportfs/exportfs.c | 31 ++++- utils/mountd/Makefile.am | 3 +- utils/mountd/cache.c | 39 +++++- utils/mountd/mountd.c | 5 +- utils/nfsd/nfsd.man | 4 + 13 files changed, 369 insertions(+), 18 deletions(-) create mode 100644 support/misc/workqueue.c