Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4148664pxb; Tue, 26 Jan 2021 13:46:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYbXpw7L+K67oifT5Pn9oURLqZsqu0a7ObXxjKxOmHEsR9RB2JO5BnAkt2B3/yOQrkUXjA X-Received: by 2002:a17:906:1f8b:: with SMTP id t11mr4674530ejr.224.1611697616146; Tue, 26 Jan 2021 13:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611697616; cv=none; d=google.com; s=arc-20160816; b=V5z9PELQl4YhO4lhVigYO+bdN9fBf5YZM7sP6weyzA6xNLg4Q5mlRpWyvpt8x+2/Yb 1EHR1x+Sd0AM6/ZYCqD4TF5E7+296R6jflmA5v9IdPigMT/f1pmezPbdbkej5+alUC9q DbXX7PS0e8PEksfoHb31vfaEoO5R+Lhk8kp695A4bNDqT3GjkiYT9rTw0do65mHeybL2 6/Ul69PRoBEeU4Oz2r/Kh7PyFPSKAGLs88RW/hxldxDqYramm6rrAZpElXdpOjBoJq00 q7tvoiDvxFPHrpBHeU1EwMNlstN06uomhJbNcPGSj1YDnd4Tw2M7PlZAYIEoVq3IIA8k 6NJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fy0VjHj93zhwqaFSJ6IhjP4jKw58sJo1bgxe0ouWC4E=; b=gFNDEXIk9r3qyARf9jycyBEVFLcaJhgAcQ2pGeFTr42avhQ9ts+DO5Y2uKmw+mfkpq I5oyqmGZvtT4aJSnrHnADU0e0KP7MgL2qEFypPO6o+1bFpE43m2aJvAIL87RkSUPsgKs j1p2tEBYL/HJh6zMIdRuVCVXzWh94yiQPqADaGui2huofM2xbqt0YbV4F31Ob5EJX33b 2e1nwl8BmKYT+XqVLlGjaqhUVKWXZhzpoMKLqyQoXoTmJj8BvZXj1e/y+5nMuWcV/tIv 0wsveUHceu/NrjWKmApuJOCKpHtVJyzQaks8z2Sl5eHNKAsDemh2Vh1JCVZYJOVihYIj PcMA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si8995644edr.281.2021.01.26.13.46.29; Tue, 26 Jan 2021 13:46:56 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387792AbhAZFdt (ORCPT + 99 others); Tue, 26 Jan 2021 00:33:49 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:52059 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728867AbhAYRHd (ORCPT ); Mon, 25 Jan 2021 12:07:33 -0500 Received: from ip5f5af0a0.dynamic.kabel-deutschland.de ([95.90.240.160] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l45K7-0006lj-0h; Mon, 25 Jan 2021 17:06:43 +0000 Date: Mon, 25 Jan 2021 18:06:40 +0100 From: Christian Brauner To: "Serge E. Hallyn" Cc: "Eric W. Biederman" , 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 , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Seth Forshee , =?utf-8?B?U3TDqXBoYW5l?= Graber , Linus Torvalds , Aleksa Sarai , Lennart Poettering , smbarber@chromium.org, Phil Estes , Kees Cook , Todd Kjos , Paul Moore , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH v6 23/40] exec: handle idmapped mounts Message-ID: <20210125170640.6ycsyod2ftxnzjzy@wittgenstein> References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-24-christian.brauner@ubuntu.com> <875z3l0y56.fsf@x220.int.ebiederm.org> <20210125164404.aullgl3vlajgkef3@wittgenstein> <20210125170316.GA8345@mail.hallyn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210125170316.GA8345@mail.hallyn.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Jan 25, 2021 at 11:03:16AM -0600, Serge Hallyn wrote: > On Mon, Jan 25, 2021 at 05:44:04PM +0100, Christian Brauner wrote: > > On Mon, Jan 25, 2021 at 10:39:01AM -0600, Eric W. Biederman wrote: > > > Christian Brauner writes: > > > > > > > When executing a setuid binary the kernel will verify in bprm_fill_uid() > > > > that the inode has a mapping in the caller's user namespace before > > > > setting the callers uid and gid. Let bprm_fill_uid() handle idmapped > > > > mounts. If the inode is accessed through an idmapped mount it is mapped > > > > according to the mount's user namespace. Afterwards the checks are > > > > identical to non-idmapped mounts. If the initial user namespace is > > > > passed nothing changes so non-idmapped mounts will see identical > > > > behavior as before. > > > > > > This does not handle the v3 capabilites xattr with embeds a uid. > > > So at least at that level you are missing some critical conversions. > > > > Thanks for looking. Vfs v3 caps are handled earlier in the series. I'm > > not sure what you're referring to here. There are tests in xfstests that > > verify vfs3 capability behavior. > > *just* to make sure i'm not misunderstanding - s/vfs3/v3/ right? Yes, in my mind it's always as "vfs v3 caps -> vfs3 caps". Sorry for the confusion.