]> git.baikalelectronics.ru Git - kernel.git/commit
loop: don't allow deleting an unspecified loop device
authorChristoph Hellwig <hch@lst.de>
Wed, 23 Jun 2021 14:59:06 +0000 (16:59 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 30 Jun 2021 21:34:13 +0000 (15:34 -0600)
commite5d66a10324f2a0c31153fd6210d99a9d00ef047
treebe57a00068fe215620f6a026f57412e27ed97e3f
parent18d1f200b3807c383d80cc00d6bbdee288e63b1f
loop: don't allow deleting an unspecified loop device

Passing a negative index to loop_lookup while return any unbound device.
Doing that for a delete does not make much sense, so add check to
explicitly reject that case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210623145908.92973-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c