Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp715290pxb; Thu, 21 Jan 2021 19:07:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRNaxXdn5T3GHS3zMuUkMxc79+mK0qtxnsokYtDVhAPIcGSjwL+roJcvXDdjL5Lq3hzdPM X-Received: by 2002:a17:906:1ed6:: with SMTP id m22mr1661469ejj.231.1611284850158; Thu, 21 Jan 2021 19:07:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611284850; cv=none; d=google.com; s=arc-20160816; b=rYhPod5pXLnbpH5Y3I8yeMlnUiFA57UzJ7t4uVfocrsUxym7/W4cZZA2lAl16gS6CQ bNDPy6yw8Gu1HHtnaX3eyQL72NYjHI0WQ1DlByZl9X9/teEsz1MfOiTLAH5MKaOUhCjm OtxiYQn8LXM5iv4Nj3VxajI6cp26lI3kqIPsv9V/5AvSJ4rRUQpl+Tl176Q19yj0ZKdl /cc1znD3zQapiGzY4K8fCRPnUOd8lRM4U/pX6cOlDAaztCt6W20pJQDVy6AFqwY+8NK9 QpgcqIjNYKG/CONZL3pB1g4ETEchDCQyHN2Ifbu6G/hJZHyp/+xRG3u7jCgvYnBt3ada r69g== 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=TwtZskmXzUr2juhFuKer4TFaM24Uw1Xl1J1GwfbgHt4=; b=1C2vS5TPS3TTHxuVke+fne46yQRwedCAHHNr3slf4vNkLWiEHZ2iHlehsgweOx61xL 2zzLBAbcimXUs+seogY8PPGXu+iO7KeR7qgoCpw83oqE+OE/uYx40fTd68NB0Cf0O6Em tipX6pLw0buJX1R/o+4iu5GXdM4ZyVQ5Jdb+BVu0pKKrJQfzqDlLzgVd7kXa0PEt5Z8i Sn384pyWrHva/Vtpcy2EySBPyrm/023w27tGhcpaVaRJitgSazZiVn5CXMLgEWul2+yP L+K4SxEZXWtgZcxi9KC7Ll7VxluBl7DcuTjyhxoQqXuOkh5+njLnN5YNJYVH0OfTZUxs 0qgg== 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 rl11si2598144ejb.33.2021.01.21.19.07.06; Thu, 21 Jan 2021 19:07:30 -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 S1726753AbhAVDE1 (ORCPT + 99 others); Thu, 21 Jan 2021 22:04:27 -0500 Received: from namei.org ([65.99.196.166]:52460 "EHLO mail.namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbhAVDEZ (ORCPT ); Thu, 21 Jan 2021 22:04:25 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.namei.org (Postfix) with ESMTPS id 054BEC92; Fri, 22 Jan 2021 03:02:52 +0000 (UTC) Date: Fri, 22 Jan 2021 14:02:51 +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 05/39] namei: make permission helpers idmapped mount aware In-Reply-To: <20210121131959.646623-6-christian.brauner@ubuntu.com> Message-ID: References: <20210121131959.646623-1-christian.brauner@ubuntu.com> <20210121131959.646623-6-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: > The two helpers inode_permission() and generic_permission() are used by > the vfs to perform basic permission checking by verifying that the > caller is privileged over an inode. In order to handle idmapped mounts > we extend the two helpers with an additional user namespace argument. > On idmapped mounts the two helpers will make sure to map the inode > according to the mount's user namespace and then peform identical > permission checks to inode_permission() and generic_permission(). If the > initial user namespace is passed nothing changes so non-idmapped mounts > will see identical behavior as before. > > Link: https://lore.kernel.org/r/20210112220124.837960-12-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