+++ /dev/null
-From 6338df4eea90a285832af592547f2b04b667d019 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 17 Jan 2024 11:19:45 +0800
-Subject: md: Fix overflow in is_mddev_idle
-
-From: Li Nan <linan122@huawei.com>
-
-[ Upstream commit 3f9f231236ce7e48780d8a4f1f8cb9fae2df1e4e ]
-
-UBSAN reports this problem:
-
- UBSAN: Undefined behaviour in drivers/md/md.c:8175:15
- signed integer overflow:
- -2147483291 - 2072033152 cannot be represented in type 'int'
- Call trace:
- dump_backtrace+0x0/0x310
- show_stack+0x28/0x38
- dump_stack+0xec/0x15c
- ubsan_epilogue+0x18/0x84
- handle_overflow+0x14c/0x19c
- __ubsan_handle_sub_overflow+0x34/0x44
- is_mddev_idle+0x338/0x3d8
- md_do_sync+0x1bb8/0x1cf8
- md_thread+0x220/0x288
- kthread+0x1d8/0x1e0
- ret_from_fork+0x10/0x18
-
-'curr_events' will overflow when stat accum or 'sync_io' is greater than
-INT_MAX.
-
-Fix it by changing sync_io, last_events and curr_events to 64bit.
-
-Signed-off-by: Li Nan <linan122@huawei.com>
-Reviewed-by: Yu Kuai <yukuai3@huawei.com>
-Link: https://lore.kernel.org/r/20240117031946.2324519-2-linan666@huaweicloud.com
-Signed-off-by: Song Liu <song@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/md/md.c | 7 ++++---
- drivers/md/md.h | 4 ++--
- include/linux/blkdev.h | 2 +-
- 3 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/md/md.c b/drivers/md/md.c
-index 506c998c0ca59..3d2befb0baf46 100644
---- a/drivers/md/md.c
-+++ b/drivers/md/md.c
-@@ -8542,14 +8542,15 @@ static int is_mddev_idle(struct mddev *mddev, int init)
- {
- struct md_rdev *rdev;
- int idle;
-- int curr_events;
-+ long long curr_events;
-
- idle = 1;
- rcu_read_lock();
- rdev_for_each_rcu(rdev, mddev) {
- struct gendisk *disk = rdev->bdev->bd_disk;
-- curr_events = (int)part_stat_read_accum(disk->part0, sectors) -
-- atomic_read(&disk->sync_io);
-+ curr_events =
-+ (long long)part_stat_read_accum(disk->part0, sectors) -
-+ atomic64_read(&disk->sync_io);
- /* sync IO will cause sync_io to increase before the disk_stats
- * as sync_io is counted when a request starts, and
- * disk_stats is counted when it completes.
-diff --git a/drivers/md/md.h b/drivers/md/md.h
-index 4f0b480974552..5910527514db2 100644
---- a/drivers/md/md.h
-+++ b/drivers/md/md.h
-@@ -50,7 +50,7 @@ struct md_rdev {
-
- sector_t sectors; /* Device size (in 512bytes sectors) */
- struct mddev *mddev; /* RAID array if running */
-- int last_events; /* IO event timestamp */
-+ long long last_events; /* IO event timestamp */
-
- /*
- * If meta_bdev is non-NULL, it means that a separate device is
-@@ -576,7 +576,7 @@ extern void mddev_unlock(struct mddev *mddev);
-
- static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
- {
-- atomic_add(nr_sectors, &bdev->bd_disk->sync_io);
-+ atomic64_add(nr_sectors, &bdev->bd_disk->sync_io);
- }
-
- static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
-diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index e255674a9ee72..02e55676e0283 100644
---- a/include/linux/blkdev.h
-+++ b/include/linux/blkdev.h
-@@ -161,7 +161,7 @@ struct gendisk {
- struct list_head slave_bdevs;
- #endif
- struct timer_rand_state *random;
-- atomic_t sync_io; /* RAID */
-+ atomic64_t sync_io; /* RAID */
- struct disk_events *ev;
- #ifdef CONFIG_BLK_DEV_INTEGRITY
- struct kobject integrity_kobj;
---
-2.43.0
-
crypto-ecdh-explicitly-zeroize-private_key.patch
alsa-emux-improve-patch-ioctl-data-validation.patch
media-dvbdev-initialize-sbuf.patch
-md-fix-overflow-in-is_mddev_idle.patch
soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch
drm-radeon-radeon_display-decrease-the-size-of-alloc.patch
nvme-fixup-comment-for-nvme-rdma-provider-type.patch
+++ /dev/null
-From 45fa2ff14c155c6c41e95f1e7642635dc955b58c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 17 Jan 2024 11:19:45 +0800
-Subject: md: Fix overflow in is_mddev_idle
-
-From: Li Nan <linan122@huawei.com>
-
-[ Upstream commit 3f9f231236ce7e48780d8a4f1f8cb9fae2df1e4e ]
-
-UBSAN reports this problem:
-
- UBSAN: Undefined behaviour in drivers/md/md.c:8175:15
- signed integer overflow:
- -2147483291 - 2072033152 cannot be represented in type 'int'
- Call trace:
- dump_backtrace+0x0/0x310
- show_stack+0x28/0x38
- dump_stack+0xec/0x15c
- ubsan_epilogue+0x18/0x84
- handle_overflow+0x14c/0x19c
- __ubsan_handle_sub_overflow+0x34/0x44
- is_mddev_idle+0x338/0x3d8
- md_do_sync+0x1bb8/0x1cf8
- md_thread+0x220/0x288
- kthread+0x1d8/0x1e0
- ret_from_fork+0x10/0x18
-
-'curr_events' will overflow when stat accum or 'sync_io' is greater than
-INT_MAX.
-
-Fix it by changing sync_io, last_events and curr_events to 64bit.
-
-Signed-off-by: Li Nan <linan122@huawei.com>
-Reviewed-by: Yu Kuai <yukuai3@huawei.com>
-Link: https://lore.kernel.org/r/20240117031946.2324519-2-linan666@huaweicloud.com
-Signed-off-by: Song Liu <song@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/md/md.c | 7 ++++---
- drivers/md/md.h | 4 ++--
- include/linux/blkdev.h | 2 +-
- 3 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/md/md.c b/drivers/md/md.c
-index e4d3741234d90..f4e0cb66288a1 100644
---- a/drivers/md/md.c
-+++ b/drivers/md/md.c
-@@ -8558,14 +8558,15 @@ static int is_mddev_idle(struct mddev *mddev, int init)
- {
- struct md_rdev *rdev;
- int idle;
-- int curr_events;
-+ long long curr_events;
-
- idle = 1;
- rcu_read_lock();
- rdev_for_each_rcu(rdev, mddev) {
- struct gendisk *disk = rdev->bdev->bd_disk;
-- curr_events = (int)part_stat_read_accum(disk->part0, sectors) -
-- atomic_read(&disk->sync_io);
-+ curr_events =
-+ (long long)part_stat_read_accum(disk->part0, sectors) -
-+ atomic64_read(&disk->sync_io);
- /* sync IO will cause sync_io to increase before the disk_stats
- * as sync_io is counted when a request starts, and
- * disk_stats is counted when it completes.
-diff --git a/drivers/md/md.h b/drivers/md/md.h
-index 7c9c13abd7cac..57463470c96f4 100644
---- a/drivers/md/md.h
-+++ b/drivers/md/md.h
-@@ -50,7 +50,7 @@ struct md_rdev {
-
- sector_t sectors; /* Device size (in 512bytes sectors) */
- struct mddev *mddev; /* RAID array if running */
-- int last_events; /* IO event timestamp */
-+ long long last_events; /* IO event timestamp */
-
- /*
- * If meta_bdev is non-NULL, it means that a separate device is
-@@ -605,7 +605,7 @@ extern void mddev_unlock(struct mddev *mddev);
-
- static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
- {
-- atomic_add(nr_sectors, &bdev->bd_disk->sync_io);
-+ atomic64_add(nr_sectors, &bdev->bd_disk->sync_io);
- }
-
- static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
-diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index a7b65d4ab616e..d4a6bc6577241 100644
---- a/include/linux/blkdev.h
-+++ b/include/linux/blkdev.h
-@@ -168,7 +168,7 @@ struct gendisk {
- struct list_head slave_bdevs;
- #endif
- struct timer_rand_state *random;
-- atomic_t sync_io; /* RAID */
-+ atomic64_t sync_io; /* RAID */
- struct disk_events *ev;
-
- #ifdef CONFIG_BLK_DEV_ZONED
---
-2.43.0
-
crypto-ecdh-explicitly-zeroize-private_key.patch
alsa-emux-improve-patch-ioctl-data-validation.patch
media-dvbdev-initialize-sbuf.patch
-md-fix-overflow-in-is_mddev_idle.patch
irqchip-loongson-select-generic_irq_effective_aff_ma.patch
soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch
gfs2-fix-null-pointer-dereference-in-gfs2_log_flush.patch
+++ /dev/null
-From 4a45a13010724614f33c9096cee4a1ee19955aa0 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 17 Jan 2024 11:19:45 +0800
-Subject: md: Fix overflow in is_mddev_idle
-
-From: Li Nan <linan122@huawei.com>
-
-[ Upstream commit 3f9f231236ce7e48780d8a4f1f8cb9fae2df1e4e ]
-
-UBSAN reports this problem:
-
- UBSAN: Undefined behaviour in drivers/md/md.c:8175:15
- signed integer overflow:
- -2147483291 - 2072033152 cannot be represented in type 'int'
- Call trace:
- dump_backtrace+0x0/0x310
- show_stack+0x28/0x38
- dump_stack+0xec/0x15c
- ubsan_epilogue+0x18/0x84
- handle_overflow+0x14c/0x19c
- __ubsan_handle_sub_overflow+0x34/0x44
- is_mddev_idle+0x338/0x3d8
- md_do_sync+0x1bb8/0x1cf8
- md_thread+0x220/0x288
- kthread+0x1d8/0x1e0
- ret_from_fork+0x10/0x18
-
-'curr_events' will overflow when stat accum or 'sync_io' is greater than
-INT_MAX.
-
-Fix it by changing sync_io, last_events and curr_events to 64bit.
-
-Signed-off-by: Li Nan <linan122@huawei.com>
-Reviewed-by: Yu Kuai <yukuai3@huawei.com>
-Link: https://lore.kernel.org/r/20240117031946.2324519-2-linan666@huaweicloud.com
-Signed-off-by: Song Liu <song@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/md/md.c | 7 ++++---
- drivers/md/md.h | 4 ++--
- include/linux/blkdev.h | 2 +-
- 3 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/drivers/md/md.c b/drivers/md/md.c
-index e575e74aabf5e..c88b50a4be82f 100644
---- a/drivers/md/md.c
-+++ b/drivers/md/md.c
-@@ -8576,14 +8576,15 @@ static int is_mddev_idle(struct mddev *mddev, int init)
- {
- struct md_rdev *rdev;
- int idle;
-- int curr_events;
-+ long long curr_events;
-
- idle = 1;
- rcu_read_lock();
- rdev_for_each_rcu(rdev, mddev) {
- struct gendisk *disk = rdev->bdev->bd_disk;
-- curr_events = (int)part_stat_read_accum(disk->part0, sectors) -
-- atomic_read(&disk->sync_io);
-+ curr_events =
-+ (long long)part_stat_read_accum(disk->part0, sectors) -
-+ atomic64_read(&disk->sync_io);
- /* sync IO will cause sync_io to increase before the disk_stats
- * as sync_io is counted when a request starts, and
- * disk_stats is counted when it completes.
-diff --git a/drivers/md/md.h b/drivers/md/md.h
-index 097d9dbd69b83..d0db98c0d33be 100644
---- a/drivers/md/md.h
-+++ b/drivers/md/md.h
-@@ -51,7 +51,7 @@ struct md_rdev {
-
- sector_t sectors; /* Device size (in 512bytes sectors) */
- struct mddev *mddev; /* RAID array if running */
-- int last_events; /* IO event timestamp */
-+ long long last_events; /* IO event timestamp */
-
- /*
- * If meta_bdev is non-NULL, it means that a separate device is
-@@ -621,7 +621,7 @@ extern void mddev_unlock(struct mddev *mddev);
-
- static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
- {
-- atomic_add(nr_sectors, &bdev->bd_disk->sync_io);
-+ atomic64_add(nr_sectors, &bdev->bd_disk->sync_io);
- }
-
- static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
-diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
-index 00e62b81a7363..a28cccd15f753 100644
---- a/include/linux/blkdev.h
-+++ b/include/linux/blkdev.h
-@@ -174,7 +174,7 @@ struct gendisk {
- struct list_head slave_bdevs;
- #endif
- struct timer_rand_state *random;
-- atomic_t sync_io; /* RAID */
-+ atomic64_t sync_io; /* RAID */
- struct disk_events *ev;
-
- #ifdef CONFIG_BLK_DEV_ZONED
---
-2.43.0
-
crypto-ecdh-explicitly-zeroize-private_key.patch
alsa-emux-improve-patch-ioctl-data-validation.patch
media-dvbdev-initialize-sbuf.patch
-md-fix-overflow-in-is_mddev_idle.patch
irqchip-loongson-select-generic_irq_effective_aff_ma.patch
iommu-arm-smmu-v3-do-not-allow-a-sva-domain-to-be-se.patch
soc-ti-wkup_m3_ipc-send-null-dummy-message-instead-o.patch