Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp591139pxx; Thu, 29 Oct 2020 09:37:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJh1ZuJygqrNRJ5Hut5aymUtUQL4oTVT+3WEBz3piy6/r93l6Uqa3D2Yf4OvKawJiw6y/B X-Received: by 2002:aa7:cf95:: with SMTP id z21mr4814243edx.346.1603989447298; Thu, 29 Oct 2020 09:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603989447; cv=none; d=google.com; s=arc-20160816; b=dMQZyLZqAnrXM/70JB+ei3xFvFng+vsP8FhuChqQZFCBALnJSjiWcpUbT+6ApsGS6I ZnLJNa0z7VmLTYc7f1YLcezm+ovjMQLCD4U6YMwc0LHUKTqLeRl1iOkQM6r+c1IVEuod J1BVtaTaYAzocMgaJd7DGBPD3ZrrUnMQyQym0+s6n5IWlTdLINx6ha+MC9/Ed0cFVnK+ CerkbBV5uUYapslAVUG4ldIXd39ez7C/4bfTKYQIF39pBgIIAZJIczLGZ44cBIEJwKey ADDCSHFWNviZql7yF8lEZgjYITG1pRuTmd885mioRvXcKLfKyQ31d40Ynqs1NZRe5dcs Pu2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+1FzFFklP1YnmghHH9t5lyMT4QSfeCr4QK0lMLwAvZE=; b=VWKg85t4MTPZlRwnTN5VZ1N1ViizYwS9MqrRaX7B49MyjYfwNDFjobxoAd74MEJS2a fKD6kOd3MGzrUYC1nAbmR7SEpun02tOqLWVn1J8VVDbbVWNkUOhCJ5JDNFzQkixYfq1M d4MnkwJYrGQP4csIezaliBTLfYsyGRBxZyL1phKaCo4dgt3ZPHcBBmn3n+vNx0fJviSM YGD+7gUAVUmkkzWrbdwTWxlAL4RaYqMI9PgCALxOvnPvnxchXb93hpaozkRr3jOwizlz 5pra73gBp4nBfvm2API2DcSbJvf+bNr4Ty2cisn3+udlmW3mykPPGmC1698H7X695YqK VuFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sargun.me header.s=google header.b=ipmMYI2Z; 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 d19si2194905ejc.188.2020.10.29.09.37.03; Thu, 29 Oct 2020 09:37:27 -0700 (PDT) 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; dkim=pass header.i=@sargun.me header.s=google header.b=ipmMYI2Z; 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 S1725923AbgJ2QgS (ORCPT + 99 others); Thu, 29 Oct 2020 12:36:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726316AbgJ2QgR (ORCPT ); Thu, 29 Oct 2020 12:36:17 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFC7AC0613D5 for ; Thu, 29 Oct 2020 09:36:16 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id x7so3689062ili.5 for ; Thu, 29 Oct 2020 09:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+1FzFFklP1YnmghHH9t5lyMT4QSfeCr4QK0lMLwAvZE=; b=ipmMYI2Zt/qFpfzA3A9nrn+MY99z/pArhalXX282jU89E0zmQx8CrbLcgUJ0+4BBYr gOYagLL2brYfKfSk0M5bDwNOwtJPX2R0TTPBFpS1s+gFhezEv2lm2yr3dsX1V9pnC8ie xjQ02ffBZ46hYZ46v5xkCdBsw/A1eNnXgRfJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+1FzFFklP1YnmghHH9t5lyMT4QSfeCr4QK0lMLwAvZE=; b=omoaYigBBWXPgmid4pvUiBt5PVSw9lYUutKtope5/l3Yw8b9XfRLtw0NCGH/VkYxxz i+gdxj28qx9+/9IwWBekmiPV9yr/bCrr4irciZiqXfF3JEYMx6rE61vy3H/EmqvweObd jHx1vcK5ETYbBldpz8E2XVsNgrQdvuqJlZ5GhLFt0PpS+YlG4vtKtVhCKYPQmdR2cqC6 ZLlE0zOThed9gqKCziwkvJpwehLfjvJZK/E9u8G8IUG/Ezu50J0DbQOqj+tb8jgGOVl1 rek5RJbn2BRBXwXHqJHNqAxp3mWNUIkUc92GbdGY/VCaWEj9W9btoGGJC4sQUxYWPvji I6KA== X-Gm-Message-State: AOAM530yGWZXyWbUD+Gt4kR0csp6smx+Nn5+vSCaVuj2vLDCYuT7w9Ya 82St582DpiBWHiQUfZCa3bSufA== X-Received: by 2002:a92:c7c7:: with SMTP id g7mr3777623ilk.303.1603989375791; Thu, 29 Oct 2020 09:36:15 -0700 (PDT) Received: from ircssh-2.c.rugged-nimbus-611.internal (80.60.198.104.bc.googleusercontent.com. [104.198.60.80]) by smtp.gmail.com with ESMTPSA id t6sm2275768ilk.5.2020.10.29.09.36.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Oct 2020 09:36:14 -0700 (PDT) Date: Thu, 29 Oct 2020 16:36:13 +0000 From: Sargun Dhillon To: Lennart Poettering Cc: "Eric W. Biederman" , 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 , Amir Goldstein , Miklos Szeredi , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Jann Horn , Seth Forshee , =?iso-8859-1?Q?St=E9phane?= Graber , Aleksa Sarai , smbarber@chromium.org, Phil Estes , Serge Hallyn , Kees Cook , Todd Kjos , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-audit@redhat.com, linux-integrity@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH 00/34] fs: idmapped mounts Message-ID: <20201029163612.GA15275@ircssh-2.c.rugged-nimbus-611.internal> References: <20201029003252.2128653-1-christian.brauner@ubuntu.com> <87pn51ghju.fsf@x220.int.ebiederm.org> <20201029160502.GA333141@gardel-login> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201029160502.GA333141@gardel-login> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Oct 29, 2020 at 05:05:02PM +0100, Lennart Poettering wrote: > On Do, 29.10.20 10:47, Eric W. Biederman (ebiederm@xmission.com) wrote: > > > Is that the use case you are looking at removing the need for > > systemd-homed to avoid chowning after lugging encrypted home directories > > from one system to another? Why would it be desirable to avoid the > > chown? > > Yes, I am very interested in seeing Christian's work succeed, for the > usecase in systemd-homed. In systemd-homed each user gets their own > private file system, and these fs shall be owned by the user's local > UID, regardless in which system it is used. The UID should be an > artifact of the local, individual system in this model, and thus > the UID on of the same user/home on system A might be picked as 1010 > and on another as 1543, and on a third as 1323, and it shouldn't > matter. This way, home directories become migratable without having to > universially sync UID assignments: it doesn't matter anymore what the > local UID is. > > Right now we do a recursive chown() at login time to ensure the home > dir is properly owned. This has two disadvantages: > > 1. It's slow. In particular on large home dirs, it takes a while to go > through the whole user's homedir tree and chown/adjust ACLs for > everything. > > 2. Because it is so slow we take a shortcut right now: if the > top-level home dir inode itself is owned by the correct user, we > skip the recursive chowning. This means in the typical case where a > user uses the same system most of the time, and thus the UID is > stable we can avoid the slowness. But this comes at a drawback: if > the user for some reason ends up with files in their homedir owned > by an unrelated user, then we'll never notice or readjust. > > > If the goal is to solve fragmented administration of uid assignment I > > suggest that it might be better to solve the administration problem so > > that all of the uids of interest get assigned the same way on all of the > > systems of interest. > > Well, the goal is to make things simple and be able to use the home > dir everywhere without any prior preparation, without central UID > assignment authority. > > The goal is to have a scheme that requires no administration, by > making the UID management problem go away. Hence, if you suggest > solving this by having a central administrative authority: this is > exactly what the model wants to get away from. > > Or to say this differently: just because I personally use three > different computers, I certainly don't want to set up LDAP or sync > UIDs manually. > > Lennart > > -- > Lennart Poettering, Berlin Can you help me understand systemd-homed a little bit? In the man page it says: systemd-homed is a system service that may be used to create, remove, change or inspect home areas (directories and network mounts and real or loopback block devices with a filesystem, optionally encrypted). It seems that the "underlay?" (If you'll call it that, maybe there is a better term) can either be a standalone block device (this sounds close to systemd machined?), a btrfs subvolume (which receives its own superblock (IIRC?, I might be wrong. It's been a while since I've used btrfs), or just be a directory that's mapped? What decides whether it's just a directory and bind-mounted (or a similar vfsmount), or an actual superblock? How is the mapping of "real UIDs" to "namespace UIDs" works when it's just a bind mount? From the perspective of multiple user namespaces, are all "underlying" UIDs mapped through, or if I try to look at another user's home directory will they not show up? Is there a reason you can't / don't / wont use overlayfs instead of bind mounts?