]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - block/ioctl.c
block: move CAP_SYS_ADMIN check in blkdev_roset()
authorIlya Dryomov <idryomov@gmail.com>
Wed, 18 Oct 2017 12:38:38 +0000 (14:38 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 25 Oct 2017 18:25:00 +0000 (12:25 -0600)
commitbb749b31c25e9b11f8f974baac8d507298ffbb70
tree7ac80dc67d5ea61bc42896d5aea13a193ba28f14
parent351499a172c0c5fc52d65ee2c62b344f369ea02a
block: move CAP_SYS_ADMIN check in blkdev_roset()

Check for CAP_SYS_ADMIN before calling into the driver, similar to
blkdev_flushbuf().  This is safer and can spare a check in the driver.

(Currently BLKROSET is overridden by md and rbd, rbd is missing the
check.  md has the check, but it covers a lot more than BLKROSET.)

Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/ioctl.c