Skip to content

Commit ead3b76

Browse files
Niklas Casselaxboe
authored andcommitted
blk-zoned: allow zone management send operations without CAP_SYS_ADMIN
Zone management send operations (BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE) should be allowed under the same permissions as write(). (write() does not require CAP_SYS_ADMIN). Additionally, other ioctls like BLKSECDISCARD and BLKZEROOUT only check if the fd was successfully opened with FMODE_WRITE. (They do not require CAP_SYS_ADMIN). Currently, zone management send operations require both CAP_SYS_ADMIN and that the fd was successfully opened with FMODE_WRITE. Remove the CAP_SYS_ADMIN requirement, so that zone management send operations match the access control requirement of write(), BLKSECDISCARD and BLKZEROOUT. Fixes: 3ed05a9 ("blk-zoned: implement ioctls") Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Aravind Ramesh <[email protected]> Reviewed-by: Adam Manzanares <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Cc: [email protected] # v4.10+ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 158ee7b commit ead3b76

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

block/blk-zoned.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,6 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
421421
if (!blk_queue_is_zoned(q))
422422
return -ENOTTY;
423423

424-
if (!capable(CAP_SYS_ADMIN))
425-
return -EACCES;
426-
427424
if (!(mode & FMODE_WRITE))
428425
return -EBADF;
429426

0 commit comments

Comments
 (0)