Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp903784ybv; Wed, 19 Feb 2020 11:36:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyg40Vg+PGgIc8LvtwlUBOUN2XmCYexnRqkmC0gIQodnKu1xAlyaE0gK5hieu6Z7OSO5dZS X-Received: by 2002:a9d:638d:: with SMTP id w13mr19662422otk.220.1582140979443; Wed, 19 Feb 2020 11:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582140979; cv=none; d=google.com; s=arc-20160816; b=ygcZBfzO9kxOsZvHWbXumSGoLJyE8YidQzmTMzAGPSAIGaHE1Bmkc/WBrh0asXhIFr xuQc9aZPBFAaxfcurt21lbt9DAbvoAUiKG1U0gaOR2Fk0AcBzXWb45p6AtNNXh9qp+pR 2wkRuZUOWmP4o9Rqtgeq1qhl+E25S4ImQkrN4MPJpGOi1BwT69G6/jqPJgErToqu5qgX EePFQPPzGUNMJgNX1sbRGJ4IZ6G3AdM8wsd8zsFcslj+DjvF7K/WZv9TTPR21tUNIyrD +lLlK5v0LnTHBvYBeOH23OzLD26SOpI0HZ0CF7J78ijgPWCkuJZVj7ihPjunOHA1W51V 5eiA== 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=rYowq1YgCsOpBlEUeEzyqGIIDmbPGK4SUS+1lRXq+JM=; b=OGXPqLCJHmfYTAF2nvAyaJAdXKWV2MNIhOpTLry9g2XZPAQ1CQDSucNoVKI3pWVBMI EL+dXfZGRKfmQQUDqZA7ygS9+FfE46JfwKcTodyFOo/BUk4t/U49UW3egLGt/9ChzC9f 8doOqL6dFcI0mcLEjhMgxX3YAzDvGEuFEpWpUQk5ImAfxeVhuBmH1pGwdYiEGPeLWHrC ZiU1iZXnIQbD13yLptgoIFdoXrKZmpSMnA+LxGYJFHf6aitON5O2fI7jSddhDX65rMaa mkX/OVt/WGV4XDeEjyBX3QvPTjJCOY1fqX8VBlIIbpsraIjvOF2+hAmKDNRscv6fXEFB fBFw== 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 a5si369532oti.22.2020.02.19.11.36.07; Wed, 19 Feb 2020 11:36:19 -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 S1726980AbgBSTgB (ORCPT + 99 others); Wed, 19 Feb 2020 14:36:01 -0500 Received: from mail.hallyn.com ([178.63.66.53]:39468 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbgBSTgA (ORCPT ); Wed, 19 Feb 2020 14:36:00 -0500 Received: by mail.hallyn.com (Postfix, from userid 1001) id B6255B4F; Wed, 19 Feb 2020 13:35:58 -0600 (CST) Date: Wed, 19 Feb 2020 13:35:58 -0600 From: "Serge E. Hallyn" To: Christian Brauner Cc: =?iso-8859-1?Q?St=E9phane?= Graber , "Eric W. Biederman" , Aleksa Sarai , Jann Horn , smbarber@chromium.org, Seth Forshee , Alexander Viro , Alexey Dobriyan , Serge Hallyn , 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: <20200219193558.GA27641@mail.hallyn.com> References: <20200218143411.2389182-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200218143411.2389182-1-christian.brauner@ubuntu.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 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 1. If I read files from the rootfs which have host uid 101000, they will appear as uid 100 to me? 2. If I read host files with uid 1000, they will appear as uid 1000 to me? 3. If I create a new file, as uid 1000, what will be the inode owning uid?