[PATCH v6 06/40] inode: make init and permission helpers idmapped mount aware
James Morris
jmorris at namei.org
Fri Jan 22 03:10:07 UTC 2021
On Thu, 21 Jan 2021, Christian Brauner wrote:
> The inode_owner_or_capable() helper determines whether the caller is the
> owner of the inode or is capable with respect to that inode. Allow it to
> handle idmapped mounts. If the inode is accessed through an idmapped
> mount it 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.
>
> Similarly, allow the inode_init_owner() helper to handle idmapped
> mounts. It initializes a new inode on idmapped mounts by mapping the
> fsuid and fsgid of the caller from the mount's user namespace. 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-13-christian.brauner@ubuntu.com
> Cc: Christoph Hellwig <hch at lst.de>
> Cc: David Howells <dhowells at redhat.com>
> Cc: Al Viro <viro at zeniv.linux.org.uk>
> Cc: linux-fsdevel at vger.kernel.org
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
Reviewed-by: James Morris <jamorris at linux.microsoft.com>
--
James Morris
<jmorris at namei.org>
More information about the Linux-security-module-archive
mailing list