Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp710936pxb; Thu, 21 Jan 2021 18:59:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKEYo8amc2fkFQI4PNnDTvq2zaTPT+NAdGNsD5ciaEMU8UqvBe5YKdCcGb73/bN7e986Vm X-Received: by 2002:a17:906:15c7:: with SMTP id l7mr1618192ejd.226.1611284397480; Thu, 21 Jan 2021 18:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611284397; cv=none; d=google.com; s=arc-20160816; b=ECFdh6PBfFhi1p6PzoLYeYLc5B6RTRyQzqyGQFZXiKnyFe22uz23aZ3jaut9DhyY0Y EhG1Dnbe+lnHlmSl4+V1IOdlX5IKPsksPlWDOOul0K4pxPW8QHxBt5obJupO+29WOwO1 QI4vYmViyncYb+3+Hrg+IxwFllkBGl7KCriwVsYNRM2qqrblQjkhVL34vlc+V7Qcqw3I HGQj9IttWtsDR3o1elRQ2eWe2eiJLgGaqfZ0E6dPFQoVMEQ+0+o+CwrvRUpNs7d/DTod YBnsfpRewgbb9Pv4ORMTnJNYy7ldOiEo+TyG49b3o17ciL3NBGjvNtWf060mtgQg1uzd iWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=pHb6QF0FeY2dQVpazYI6JbtRlQY4Jyc/qLIiGnXk7sE=; b=0idn2Q4Jf4xeKpsrnfn2UeNWQV6vSEj4Y3LC5CkfESqwgp+pe2W6Cpks0ucCsov7Zh pMddkp4KsbGv2TQ8+HRlsyKZZR/64JATkTpxeNdiDLjZsuT6HfWvOf6Vjo8i0OFSkIq9 EnsG0TnCV/TY8cU9ueyS7P2UbMomgQjs3998jYuZS6gGle3AWZ6NAJHTEpXyI0i6ujSH u1Tcib0ov3AYl09QR/Ce3miX3I7aEMjdtYxNRssRAw+qmPQvDPsa7TVOqUmHYAW7HgJK iL+I2WH+T+vt1GWeG+UDAJIYS1hRQ5XT06YS1xksOOAdIKl8LWhg+62XIv8/o+2pTv7F X0pA== 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 uz30si2467481ejb.70.2021.01.21.18.59.33; Thu, 21 Jan 2021 18:59:57 -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 S1726462AbhAVC6q (ORCPT + 99 others); Thu, 21 Jan 2021 21:58:46 -0500 Received: from namei.org ([65.99.196.166]:52388 "EHLO mail.namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbhAVC6p (ORCPT ); Thu, 21 Jan 2021 21:58:45 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.namei.org (Postfix) with ESMTPS id D8A9E49C; Fri, 22 Jan 2021 02:57:11 +0000 (UTC) Date: Fri, 22 Jan 2021 13:57:11 +1100 (AEDT) From: James Morris To: Christian Brauner cc: Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org, John Johansen , 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-15?Q?St=E9phane_Graber?= , Linus Torvalds , Aleksa Sarai , Lennart Poettering , "Eric W. Biederman" , 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 04/40] capability: handle idmapped mounts In-Reply-To: <20210121131959.646623-5-christian.brauner@ubuntu.com> Message-ID: References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-5-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, 21 Jan 2021, Christian Brauner wrote: > In order to determine whether a caller holds privilege over a given > inode the capability framework exposes the two helpers > privileged_wrt_inode_uidgid() and capable_wrt_inode_uidgid(). The former > verifies that the inode has a mapping in the caller's user namespace and > the latter additionally verifies that the caller has the requested > capability in their current user namespace. > If the inode is accessed through an idmapped mount map it into the > mount's user namespace. Afterwards the checks are identical to > non-idmapped inodes. If the initial user namespace is passed all > operations are a nop so non-idmapped mounts will not see a change in > behavior. > > Link: https://lore.kernel.org/r/20210112220124.837960-11-christian.brauner@ubuntu.com > Cc: Christoph Hellwig > Cc: David Howells > Cc: Al Viro > Cc: linux-fsdevel@vger.kernel.org > Reviewed-by: Christoph Hellwig > Acked-by: Serge Hallyn > Signed-off-by: Christian Brauner Reviewed-by: James Morris -- James Morris