From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DEC6C2BA83 for ; Sun, 16 Feb 2020 16:03:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02A532086A for ; Sun, 16 Feb 2020 16:03:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgBPQDQ (ORCPT ); Sun, 16 Feb 2020 11:03:16 -0500 Received: from albireo.enyo.de ([37.24.231.21]:41926 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728293AbgBPQDP (ORCPT ); Sun, 16 Feb 2020 11:03:15 -0500 X-Greylist: delayed 325 seconds by postgrey-1.27 at vger.kernel.org; Sun, 16 Feb 2020 11:03:14 EST Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1j3MID-0006zV-7T; Sun, 16 Feb 2020 15:57:13 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1j3MGr-0001RD-Ge; Sun, 16 Feb 2020 16:55:49 +0100 From: Florian Weimer 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 v2 00/28] user_namespace: introduce fsid mappings References: <20200214183554.1133805-1-christian.brauner@ubuntu.com> Date: Sun, 16 Feb 2020 16:55:49 +0100 In-Reply-To: <20200214183554.1133805-1-christian.brauner@ubuntu.com> (Christian Brauner's message of "Fri, 14 Feb 2020 19:35:26 +0100") Message-ID: <87pneesf0a.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: * Christian Brauner: > 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. I'm worried that this is a bit of a management nightmare because the data about the mapping does not live within the file system (it's externally determined, static, but crucial to the interpretation of file system content). I expect that many organizations have centralized allocation of user IDs, but centralized allocation of the static mapping does not appear feasible. Have you considered a more complex design, where untranslated nested user IDs are store in a file attribute (or something like that)? This way, any existing user ID infrastructure can be carried over largely unchanged.