Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3564006pxb; Mon, 25 Jan 2021 21:35:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5wspMszU9Pkomag6c0nrWvijxbx7+A+MdWh1a4YwWNGC1pss3ES7ktmPisP0NLzLVQzfE X-Received: by 2002:a50:f288:: with SMTP id f8mr3191108edm.388.1611639341384; Mon, 25 Jan 2021 21:35:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611639341; cv=none; d=google.com; s=arc-20160816; b=arKYc3Drb8Ac84IMlueh4FyRs9mBhqmQQJp0yVhleaCRWeh77hhccfYNF9slsLzOtb zvlRTySRTb8sFqhkUESGdYBLt5RR2TiWZo1TrPPcLmFwy55JG++8hoJmBC8F2qV82U1O oy35pNLgCz+pSiYOOhF3yXryyoZ2rHfzTnkWrcK9451ld8HX8lJ7xQ0wenZcGOW+w5Ny WCpQKMJz7UQjHSBCB3AMceAyBmtEqFvf+1SE/uqKLf9x3+BlR1kjP9zzZP7nnPhEITQ/ h43G3PN2xNkdX4Ke3UoOtr5mc5CpJoL955fFFdCZUCEtjMC8Bnmta99CcJI/Ka8nvw9I ZuXQ== 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=BG4Gum89Ovq+V7Ax3/hya4lZwgeMboI6HPisxkw4cww=; b=dPLrQD9pi4I7mp99Z9TFmeQF83rTTujw4itegt4dvmhRYmcwtEZkEPmV1Z8dAHA8Ks V1YiWgN1GR9JKnQG/fxvvC1M4srDIJ5d+Zibr596jkhn4Vs2GVRS1m6G3fTnNhJIp223 6wuxO1wNzvWPkb2jtFNIUN6AXgWr36n9nNoxxnXePRKImv9+WlDSLtxLmHIXSwUm8YUJ CW5aixJ7RG7S/7onKG2ufhcS9e8Vx04+YR0XLfkZY/THSSHtLPQ0x6xYT3zpEE4eCFC0 N3Ej3vgWF/DqVj8fpQo1D5OLb+HNxNM+hAKStA0q408U37gLy9MI3ONV9L7iaS5oNY4c FpYA== 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 a1si7912370eds.422.2021.01.25.21.35.16; Mon, 25 Jan 2021 21:35:41 -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 S1733027AbhAZFdm (ORCPT + 99 others); Tue, 26 Jan 2021 00:33:42 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:51410 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730672AbhAYQpn (ORCPT ); Mon, 25 Jan 2021 11:45:43 -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 1l44yF-00055J-1o; Mon, 25 Jan 2021 16:44:07 +0000 Date: Mon, 25 Jan 2021 17:44:04 +0100 From: Christian Brauner To: "Eric W. Biederman" Cc: 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 , Serge Hallyn , 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: <20210125164404.aullgl3vlajgkef3@wittgenstein> References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-24-christian.brauner@ubuntu.com> <875z3l0y56.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <875z3l0y56.fsf@x220.int.ebiederm.org> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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. Christian