Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp567550pxb; Thu, 14 Jan 2021 12:49:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaiogpK/3jkeybtT9+mY/8mQ8RPeBl5A01A1+ZhGOvz3gy8n0OONi64ga8pD0QWevOIUtM X-Received: by 2002:a17:906:a8e:: with SMTP id y14mr6365817ejf.47.1610657372550; Thu, 14 Jan 2021 12:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610657372; cv=none; d=google.com; s=arc-20160816; b=ytA3FR4QAml8aYBHLnNNBc6eMfUCeC8SL4tkhbJlDfI1oQOKhWmeZ6OH7g32ZDPW9L DIxkZZkFFEnd9Ylnv0igaTTjKEAxKQoFF8eOO3xNdT85CgEiBj0BtlIbNlzT6neF4+F8 +GyJj4ToLJ43nrNBDgUxoKx5+/f316E6dhXSsU98LhRhivMPrAtBwTZIT50pQq6Urrvm 5HietXwNS35nhE3fy0L1mc/o1fU3/t28sUqRqYD73NY4J4Q8wBzzoPCqifLeM0hxJ6a+ uFbCNTmMPL0SI2yqHmA3Y+OhLdPNuSNY3eiceMqUWbHiE+13GpIBf7HUnNxP87X4z/EY c3mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=yFcy7JsJVIatH7VN4ITYswYPWoKFDHCyYP5iWgZqJRA=; b=vgqjEdSZLujWwN6X4liYi+LG6yc45/7YT/FSCOLXlMw5zCp5rpFh3pOyLhNc7Ltmds xLsIeQgiTLRwbT07AfTzSX7Lwie8ZMlMOkdXtldWGdkw1Nf18x6NvpSUOA+rCLyNSaRI RaTO4VWK8gzf5Utg9Xw5Ui9D3bezvRa5isZfSOo5OxR0cPztYwl5M9Zyxp74c48jfatp +BdOXMGEZnbWOOoVzGrMmGlGNICBRkKzlMfDZy08Pm3RNS1S9MLvijEzsF4l2fUe48QR 60mGNmm/bYIJyYFWpVe3tXiadq34l36UyioBb/bgQVazaUcUZTGFWUXa6JzLWUW0DG7H mciA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si3052254edv.261.2021.01.14.12.49.05; Thu, 14 Jan 2021 12:49:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbhANUod (ORCPT + 99 others); Thu, 14 Jan 2021 15:44:33 -0500 Received: from mail107.syd.optusnet.com.au ([211.29.132.53]:58162 "EHLO mail107.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbhANUod (ORCPT ); Thu, 14 Jan 2021 15:44:33 -0500 Received: from dread.disaster.area (pa49-179-167-107.pa.nsw.optusnet.com.au [49.179.167.107]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 84A94D5E47A; Fri, 15 Jan 2021 07:43:35 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1l09Sw-006UW3-9I; Fri, 15 Jan 2021 07:43:34 +1100 Date: Fri, 15 Jan 2021 07:43:34 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: Christian Brauner , Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, John Johansen , James Morris , Mimi Zohar , Dmitry Kasatkin , Stephen Smalley , Casey Schaufler , Arnd Bergmann , Andreas Dilger , OGAWA Hirofumi , Geoffrey Thomas , Mrunal Patel , Josh Triplett , Andy Lutomirski , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Seth Forshee , =?iso-8859-1?Q?St=E9phane?= Graber , Linus Torvalds , Aleksa Sarai , Lennart Poettering , "Eric W. Biederman" , smbarber@chromium.org, Phil Estes , Serge Hallyn , Kees Cook , Todd Kjos , Paul Moore , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH v5 00/42] idmapped mounts Message-ID: <20210114204334.GK331610@dread.disaster.area> References: <20210112220124.837960-1-christian.brauner@ubuntu.com> <20210114171241.GA1164240@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210114171241.GA1164240@magnolia> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=F8MpiZpN c=1 sm=1 tr=0 cx=a_idp_d a=+wqVUQIkAh0lLYI+QRsciw==:117 a=+wqVUQIkAh0lLYI+QRsciw==:17 a=kj9zAlcOel0A:10 a=EmqxpYm9HcoA:10 a=7-415B0cAAAA:8 a=In5g3teRgiYIkOrEuZ4A:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Jan 14, 2021 at 09:12:41AM -0800, Darrick J. Wong wrote: > On Tue, Jan 12, 2021 at 11:00:42PM +0100, Christian Brauner wrote: > > Hey everyone, > > > > The only major change is the inclusion of hch's patch to port XFS to > > support idmapped mounts. Thanks to Christoph for doing that work. > > Yay :) > > > (For a full list of major changes between versions see the end of this > > cover letter. > > Please also note the large xfstests testsuite in patch 42 that has been > > kept as part of this series. It verifies correct vfs behavior with and > > without idmapped mounts including covering newer vfs features such as > > io_uring. > > I currently still plan to target the v5.12 merge window.) > > > > With this patchset we make it possible to attach idmappings to mounts, > > i.e. simply put different bind mounts can expose the same file or > > directory with different ownership. > > Shifting of ownership on a per-mount basis handles a wide range of > > long standing use-cases. Here are just a few: > > - Shifting of a subset of ownership-less filesystems (vfat) for use by > > multiple users, effectively allowing for DAC on such devices > > (systemd, Android, ...) > > - Allow remapping uid/gid on external filesystems or paths (USB sticks, > > network filesystem, ...) to match the local system's user and groups. > > (David Howells intends to port AFS as a first candidate.) > > - Shifting of a container rootfs or base image without having to mangle > > every file (runc, Docker, containerd, k8s, LXD, systemd ...) > > - Sharing of data between host or privileged containers with > > unprivileged containers (runC, Docker, containerd, k8s, LXD, ...) > > - Data sharing between multiple user namespaces with incompatible maps > > (LXD, k8s, ...) > > That sounds neat. AFAICT, the VFS passes the filesystem a mount userns > structure, which is then carried down the call stack to whatever > functions actually care about mapping kernel [ug]ids to their ondisk > versions? > > Does quota still work after this patchset is applied? There isn't any > mention of that in the cover letter and I don't see a code patch, so > does that mean everything just works? I'm particularly curious about > whether there can exist processes with CAP_SYS_ADMIN and an idmapped > mount? Syscalls like bulkstat and quotactl present file [ug]ids to > programs, but afaict there won't be any translating going on? bulkstat is not allowed inside user namespaces. It's an init namespace only thing because it provides unchecked/unbounded access to all inodes in the filesystem, not just those contained within a specific mount container. Hence I don't think bulkstat output (and other initns+root only filesystem introspection APIs) should be subject to or concerned about idmapping. Cheers, Dave. -- Dave Chinner david@fromorbit.com