Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3497531pxb; Mon, 25 Jan 2021 18:55:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcq/S5H9emoNQQ63jt/ctAQjQgFAeAfku6CZzFtgoydFDO9hHsDoavTNTSsn7dCzAyu13a X-Received: by 2002:a17:907:7295:: with SMTP id dt21mr2216552ejc.518.1611629711066; Mon, 25 Jan 2021 18:55:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611629711; cv=none; d=google.com; s=arc-20160816; b=vYu4ALKByTGIguIOvNNgoyFzaLrNCLeTpPAwnIoQ/TBvHQ3m3xXnCknFMouFXv7sZt ptilLiyxqQ4T0GvmNbVwP+LeXkAK/f1GFEP9E439OzxAbqsA5Yo2ZLGREpHmiMRuuOKc nSGhThrXuamsJBJ8ktMy9HvK0Vac1q86oWfj/YJ42hLauA1xUXjC3oZR3Kp8gp1tD5nO HHVDZdY5D4SuPTRGHQASPP0Y4RMmEM3bZQG+PlZimxuRqnQ2d1zMYJ7VCrX4gBNux6CS J13pNn5QezuuYFaQGNKIVubwYPKU86f5uUNH/XNq+JvwewJY30DlBi4yWrvc0BZEs2kV YtGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=s8obHLPBHot/BO4XtSXP8ysdxBy4sXwFeg2AB4coVVE=; b=mRy54ibUzgA3BhSUWnJpTmpHoN8SYKCTStEDLsKQxKOYw5CfGyUzHFLyC1t1OZnt+i 9p8kd/Zp5wCqJ+g2RAaAKpeKBYfBHmh/jMg+4Nj1mn++O+bfiDGB9CAihmFeMdfXpSPQ JBLcRldP8BKwLa0f06wu72aim4XOc6n1usDgzzjMHxTQ2tY0tPE7hnp3vOfp/HWY1sQp m1ez1BOO5EOXR7mLjU36DsTVtkPPnzLpEOn/kfbWwKvdtZ2gZKBAbHRKk0Z++yOgYAKB ArAuXCFuK+fqZ3FsWtIr1HzJhH365d4XuwvfSE5Cy2J6zTIgC3bibYE0yKDEyqEJvaL3 ID+A== 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 c4si7896212edr.176.2021.01.25.18.54.46; Mon, 25 Jan 2021 18:55:11 -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 S1729210AbhAYRMQ (ORCPT + 99 others); Mon, 25 Jan 2021 12:12:16 -0500 Received: from mail.hallyn.com ([178.63.66.53]:50740 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729955AbhAYRLm (ORCPT ); Mon, 25 Jan 2021 12:11:42 -0500 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Mon, 25 Jan 2021 12:11:14 EST Received: by mail.hallyn.com (Postfix, from userid 1001) id E0A35CAF; Mon, 25 Jan 2021 11:03:16 -0600 (CST) Date: Mon, 25 Jan 2021 11:03:16 -0600 From: "Serge E. Hallyn" To: Christian Brauner 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 , =?iso-8859-1?Q?St=E9phane?= 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: <20210125170316.GA8345@mail.hallyn.com> References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-24-christian.brauner@ubuntu.com> <875z3l0y56.fsf@x220.int.ebiederm.org> <20210125164404.aullgl3vlajgkef3@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210125164404.aullgl3vlajgkef3@wittgenstein> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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?