Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1001756ybv; Wed, 19 Feb 2020 13:48:56 -0800 (PST) X-Google-Smtp-Source: APXvYqykePR1NtBkPDg/35mLVk//DVaywz77xjZiI0kn1WhGSKsYIkUPWd2AlDTxDVH1gyPDqDPi X-Received: by 2002:a9d:7852:: with SMTP id c18mr20221095otm.247.1582148936623; Wed, 19 Feb 2020 13:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582148936; cv=none; d=google.com; s=arc-20160816; b=F9aIj2szeM+9c7Lvb0kK5+2cG0uMEMaPg3SQVJQV5wJMf5G9kVm8U3r3tQxvX4YwTI 0cyKF1KcgdXDczNfUC+uPIZdJkDICmzP9N52T4i5CdsCNuFD+Z4+Vak6qZrrJ+WMVgRN Bc8BMLpx+ZA3RnmIkzHpbOOQ1KjXzTNHiesZ8q2SKVa1AUZitakhzpVFMWu2wi1iFtCm IymXhhktCZTp/3JDeCe/H2gdictp0KcppknLGalS6CQfEAVzpaYuLxtprQ6KzL6wZJDm jjg4S4tkjzZas7hc1uMwkNm9YW9j6RFlzquwyO/CkIF74O0660HpyAc9cZg5pUeLtzCY JeJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=y6axgNNVPXyIRTOlwV9MGIRoQv8qNnuW19D0X8Hz1Kc=; b=Ie2DFwWTOHdz4NstFU0kM8HbBGaGCI5yqGs5+04CUsn6IgFh8Ye/4lG+hNMbSlFnGu irIDPUA2iI19cq8mZa+H7obHp8b9WHzgkU0gw6ahmZXWqAMQEePLL+RnjTSLsEBsDMtN cnRkRkCRIHApY/U7lofruD89EKM2iZxKcA0TuAhnutdg2MRQE3dHVI4AqvPQJAOlihN+ CMqTjcXbEzP0TBQUsryBg1Ck+3XWbzvKZfWPG8K1rPgnDSvi8O+oj5c2oWVQcBgCRNfU mFDMx/tHJwGJweexU3zODdtb+OFWrgfWRRbwrW9R/kPeCWwu3cH1a7otB63Y4UfbieFY FxZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si511803otl.60.2020.02.19.13.48.43; Wed, 19 Feb 2020 13:48:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727488AbgBSVsk (ORCPT + 99 others); Wed, 19 Feb 2020 16:48:40 -0500 Received: from mail.hallyn.com ([178.63.66.53]:41866 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbgBSVsj (ORCPT ); Wed, 19 Feb 2020 16:48:39 -0500 Received: by mail.hallyn.com (Postfix, from userid 1001) id 947E77DD; Wed, 19 Feb 2020 15:48:37 -0600 (CST) Date: Wed, 19 Feb 2020 15:48:37 -0600 From: "Serge E. Hallyn" To: "Serge E. Hallyn" Cc: Christian Brauner , =?iso-8859-1?Q?St=E9phane?= Graber , "Eric W. Biederman" , Aleksa Sarai , Jann Horn , smbarber@chromium.org, Seth Forshee , Alexander Viro , Alexey Dobriyan , James Morris , Kees Cook , Jonathan Corbet , Phil Estes , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v3 00/25] user_namespace: introduce fsid mappings Message-ID: <20200219214837.GA29159@mail.hallyn.com> References: <20200218143411.2389182-1-christian.brauner@ubuntu.com> <20200219193558.GA27641@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200219193558.GA27641@mail.hallyn.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 19, 2020 at 01:35:58PM -0600, Serge E. Hallyn wrote: > On Tue, Feb 18, 2020 at 03:33:46PM +0100, Christian Brauner wrote: > > With fsid mappings we can solve this by writing an id mapping of 0 > > 100000 100000 and an fsid mapping of 0 300000 100000. On filesystem > > access the kernel will now lookup the mapping for 300000 in the fsid > > mapping tables of the user namespace. And since such a mapping exists, > > the corresponding files will have correct ownership. > > So if I have > > /proc/self/uid_map: 0 100000 100000 > /proc/self/fsid_map: 1000 1000 1 Oh, sorry. Your explanation in 20/25 i think set me straight, though I need to think through a few more examples. ... > 3. If I create a new file, as nsuid 1000, what will be the inode owning kuid? (Note - I edited the quoted txt above to be more precise) I'm still not quite clear on this. I believe the fsid mapping will take precedence so it'll be uid 1000 ? Per mount behavior would be nice there, but perhaps unwieldy.