summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>2021-12-18 12:41:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-04 14:13:04 +0300
commitee12aa483f6c8cecbd5a4c794867fee0e068b822 (patch)
tree9c7fc57af9379ea51bc1ad3df37f76b3adbca4ee
parent3d89d0c4a1c6d4d2a755e826351b0a101dbc86f3 (diff)
downloadlinux-ee12aa483f6c8cecbd5a4c794867fee0e068b822.tar.xz
block: use "unsigned long" for blk_validate_block_size().
commit 37ae5a0f5287a52cf51242e76ccf198d02ffe495 upstream. Since lo_simple_ioctl(LOOP_SET_BLOCK_SIZE) and ioctl(NBD_SET_BLKSIZE) pass user-controlled "unsigned long arg" to blk_validate_block_size(), "unsigned long" should be used for validation. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/9ecbf057-4375-c2db-ab53-e4cc0dff953d@i-love.sakura.ne.jp Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: David Hunter <david.hunter.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--include/linux/blkdev.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8f0aafae09d9..d76682d2f9dc 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -56,7 +56,7 @@ struct blk_stat_callback;
*/
#define BLKCG_MAX_POLS 5
-static inline int blk_validate_block_size(unsigned int bsize)
+static inline int blk_validate_block_size(unsigned long bsize)
{
if (bsize < 512 || bsize > PAGE_SIZE || !is_power_of_2(bsize))
return -EINVAL;