History

block: use "unsigned long" for blk_validate_block_size().

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.

Tetsuo Handa committed 4 years ago

Commit 37ae5a01 parent 99d86901 file · +1 −1Browse files

Showing the changes to include/linux/blkdev.h (1 of 1 file). Show all

Unified · Split

include/linux/blkdev.h+1−1
@@ -45,7 +45,7 @@ struct blk_crypto_profile; · 44 unmodified lines
4545 */
4646 #define BLKCG_MAX_POLS 6
4747
48−static inline int blk_validate_block_size(unsigned int bsize)
48+static inline int blk_validate_block_size(unsigned long bsize)
4949 {
5050 if (bsize < 512 || bsize > PAGE_SIZE || !is_power_of_2(bsize))
5151 return -EINVAL;