]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
UBUNTU: SAUCE: 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, 29 Feb 2016 16:03:58 +0000 (09:03 -0700)
commit4a95988607f5625f680e9062daa1fd7b1b876d37
tree699167383468dec02739f67bee9eddf3aeb01b4b
parent7effec5491c0173714acec6b5278116468dad608
UBUNTU: SAUCE: 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.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@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