From: Greg Kroah-Hartman Date: Thu, 22 Aug 2024 00:07:36 +0000 (+0800) Subject: 5.10-stable patches X-Git-Tag: v6.1.107~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1a7433d122f05f92dc0396b7b05cf0679b2e696;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: block-use-unsigned-long-for-blk_validate_block_size.patch --- diff --git a/queue-5.10/block-use-unsigned-long-for-blk_validate_block_size.patch b/queue-5.10/block-use-unsigned-long-for-blk_validate_block_size.patch new file mode 100644 index 00000000000..eff29fe3b35 --- /dev/null +++ b/queue-5.10/block-use-unsigned-long-for-blk_validate_block_size.patch @@ -0,0 +1,34 @@ +From 37ae5a0f5287a52cf51242e76ccf198d02ffe495 Mon Sep 17 00:00:00 2001 +From: Tetsuo Handa +Date: Sat, 18 Dec 2021 18:41:56 +0900 +Subject: block: use "unsigned long" for blk_validate_block_size(). + +From: Tetsuo Handa + +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 +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/9ecbf057-4375-c2db-ab53-e4cc0dff953d@i-love.sakura.ne.jp +Signed-off-by: Jens Axboe +Signed-off-by: David Hunter +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/blkdev.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -59,7 +59,7 @@ struct blk_keyslot_manager; + */ + #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; diff --git a/queue-5.10/series b/queue-5.10/series index 7cbee5df5c3..86a7d6b2882 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -83,3 +83,4 @@ ext4-set-the-type-of-max_zeroout-to-unsigned-int-to-.patch nvmet-rdma-fix-possible-bad-dereference-when-freeing.patch hrtimer-prevent-queuing-of-hrtimer-without-a-functio.patch gtp-pull-network-headers-in-gtp_dev_xmit.patch +block-use-unsigned-long-for-blk_validate_block_size.patch