Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp598075pxx; Thu, 29 Oct 2020 09:47:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwPA3IgmwTwAQ6y+RqeRQNTFj14qo1yh2KyzRoi6vV04YGZ4e9HYfNiyCF0kDA4z/vtOFA X-Received: by 2002:a17:906:3689:: with SMTP id a9mr4873619ejc.403.1603990061825; Thu, 29 Oct 2020 09:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603990061; cv=none; d=google.com; s=arc-20160816; b=xOJSWNWwUFOIl0fMXAxiE/jrQRfOpAznZEmWRIemi4vxuYnu0tDcUTXsXfFM40IAHs H9y8Zhc0vnjlfBaqKkJX2V0PYBt3DcrZp9rqNou3JE8NMnTFUoKhE7VlUDSnbPXAkcJO ++qCm/6xd7tSZk+zs4/xjnu4tBSvz2WLsA/6n659M3mzhQ3dzUr2IEv3SdPYtsSaxqXh pGiheD27813j6k8WVjSh3o2Kxti80nv4sMcxBQkZrmCkHpN9qm0JAfqxKpWKfo17PWso Imjh8Zti8AOY77bKbp1UQzkTovd7Jd+WUGnEDgABnbFfgooQj0B7fl3FSsw5exfpfw/c MdBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:user-agent:message-id :in-reply-to:date:references:cc:to:from; bh=iW1w1JQW1IGq1aLxN70yDcWC7IzJYrsQOBdX+02Mxow=; b=ZeXdUzIRQMIUPCDelqi5+p5mcjS6Ml/Z0THoRt/x//POqwXICE8c3fWPTAukCE4wEZ 7VUKThG0xaKFIJ2Bc1lUvmbNR12t/ZonQIUJGAM86Emzvu4sgCwnS9NxYSZQhbXKwFpH /pmsR/ra567fDRZFx/t9Rj9R+dWncbqorLiIKp3+iRX//TqPzAiENaPES4wNAeizBNN5 pTSgRvE1QRMH6OTq2o7wD7Xrm4ha4ivQnKG7R7zPcFuaT2T70FhDMIyLleikXE7uyYSm JpktE96AopQjrct7fyQkv/aMyBkhYUBwyb7zVMngqwTzq5fzyzpJnOB/74WcC04nSZUb QY+Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si3402074edi.14.2020.10.29.09.47.17; Thu, 29 Oct 2020 09:47:41 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728027AbgJ2Qo5 (ORCPT + 99 others); Thu, 29 Oct 2020 12:44:57 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:60340 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbgJ2Qo5 (ORCPT ); Thu, 29 Oct 2020 12:44:57 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kYB2Q-009eVE-Gs; Thu, 29 Oct 2020 10:44:34 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1kYB2N-0000rc-Un; Thu, 29 Oct 2020 10:44:34 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Tycho Andersen Cc: Christian Brauner , Lennart Poettering , Mimi Zohar , David Howells , Andreas Dilger , containers@lists.linux-foundation.org, Miklos Szeredi , smbarber@chromium.org, Christoph Hellwig , linux-ext4@vger.kernel.org, Mrunal Patel , Kees Cook , Arnd Bergmann , Jann Horn , selinux@vger.kernel.org, Josh Triplett , linux-fsdevel@vger.kernel.org, Alexander Viro , Andy Lutomirski , OGAWA Hirofumi , Geoffrey Thomas , James Bottomley , John Johansen , Theodore Tso , Seth Forshee , Dmitry Kasatkin , Stephen Smalley , Jonathan Corbet , linux-unionfs@vger.kernel.org, linux-security-module@vger.kernel.org, linux-audit@redhat.com, linux-api@vger.kernel.org, Casey Schaufler , Alban Crequy , linux-integrity@vger.kernel.org, Todd Kjos References: <20201029003252.2128653-1-christian.brauner@ubuntu.com> <87pn51ghju.fsf@x220.int.ebiederm.org> <20201029161231.GA108315@cisco> Date: Thu, 29 Oct 2020 11:44:33 -0500 In-Reply-To: <20201029161231.GA108315@cisco> (Tycho Andersen's message of "Thu, 29 Oct 2020 10:12:31 -0600") Message-ID: <87blglc77y.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1kYB2N-0000rc-Un;;;mid=<87blglc77y.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18l/ky6v0TPp3RfG1uVSiI/idjNvZVspy0= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.3 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,XMNoVowels autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Tycho Andersen X-Spam-Relay-Country: X-Spam-Timing: total 1948 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (0.6%), b_tie_ro: 10 (0.5%), parse: 0.99 (0.1%), extract_message_metadata: 15 (0.8%), get_uri_detail_list: 1.95 (0.1%), tests_pri_-1000: 9 (0.5%), tests_pri_-950: 1.21 (0.1%), tests_pri_-900: 1.08 (0.1%), tests_pri_-90: 220 (11.3%), check_bayes: 213 (10.9%), b_tokenize: 12 (0.6%), b_tok_get_all: 11 (0.5%), b_comp_prob: 3.1 (0.2%), b_tok_touch_all: 183 (9.4%), b_finish: 0.92 (0.0%), tests_pri_0: 357 (18.3%), check_dkim_signature: 0.58 (0.0%), check_dkim_adsp: 2.7 (0.1%), poll_dns_idle: 1319 (67.7%), tests_pri_10: 2.1 (0.1%), tests_pri_500: 1327 (68.1%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 00/34] fs: idmapped mounts X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Tycho Andersen writes: > Hi Eric, > > On Thu, Oct 29, 2020 at 10:47:49AM -0500, Eric W. Biederman wrote: >> Christian Brauner writes: >> >> > Hey everyone, >> > >> > I vanished for a little while to focus on this work here so sorry for >> > not being available by mail for a while. >> > >> > Since quite a long time we have issues with sharing mounts between >> > multiple unprivileged containers with different id mappings, sharing a >> > rootfs between multiple containers with different id mappings, and also >> > sharing regular directories and filesystems between users with different >> > uids and gids. The latter use-cases have become even more important with >> > the availability and adoption of systemd-homed (cf. [1]) to implement >> > portable home directories. >> >> Can you walk us through the motivating use case? >> >> As of this year's LPC I had the distinct impression that the primary use >> case for such a feature was due to the RLIMIT_NPROC problem where two >> containers with the same users still wanted different uid mappings to >> the disk because the users were conflicting with each other because of >> the per user rlimits. >> >> Fixing rlimits is straight forward to implement, and easier to manage >> for implementations and administrators. > > Our use case is to have the same directory exposed to several > different containers which each have disjoint ID mappings. Why do the you have disjoint ID mappings for the users that are writing to disk with the same ID? >> Reading up on systemd-homed it appears to be a way to have encrypted >> home directories. Those home directories can either be encrypted at the >> fs or at the block level. Those home directories appear to have the >> goal of being luggable between systems. If the systems in question >> don't have common administration of uids and gids after lugging your >> encrypted home directory to another system chowning the files is >> required. >> >> 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? > > Not just systemd-homed, but LXD has to do this, I asked why the same disk users are assigned different kuids and the only reason I have heard that LXD does this is the RLIMIT_NPROC problem. Perhaps there is another reason. In part this is why I am eager to hear peoples use case, and why I was trying very hard to make certain we get the requirements. I want the real requirements though and some thought, not just we did this and it hurts. Changning the uids on write is a very hard problem, and not just in implementating it but also in maintaining and understanding what is going on. Eric