]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: SAUCE: (namespace) block_dev: Support checking inode permissions in lookup_bdev()
authorSeth Forshee <seth.forshee@canonical.com>
Fri, 31 Jul 2015 17:58:34 +0000 (12:58 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
commitcc8261266eb4b394557742ed94143e83ecef7fb9
treee7a279a570a5f6157ca476616effd1698af07af4
parent67e4ee33ef60fc61dff549254824ada8323ac7aa
UBUNTU: SAUCE: (namespace) block_dev: Support checking inode permissions in lookup_bdev()

When looking up a block device by path no permission check is
done to verify that the user has access to the block device inode
at the specified path. In some cases it may be necessary to
check permissions towards the inode, such as allowing
unprivileged users to mount block devices in user namespaces.

Add an argument to lookup_bdev() to optionally perform this
permission check. A value of 0 skips the permission check and
behaves the same as before. A non-zero value specifies the mask
of access rights required towards the inode at the specified
path. The check is always skipped if the user has CAP_SYS_ADMIN.

All callers of lookup_bdev() currently pass a mask of 0, so this
patch results in no functional change. Subsequent patches will
add permission checks where appropriate.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/md/bcache/super.c
drivers/md/dm-table.c
drivers/mtd/mtdsuper.c
fs/block_dev.c
fs/quota/quota.c
include/linux/fs.h