]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop hwmon-pc87360-bounds-check-data-innr-usage.patch
authorSasha Levin <sashal@kernel.org>
Fri, 2 Feb 2024 00:56:48 +0000 (19:56 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 2 Feb 2024 00:56:48 +0000 (19:56 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
14 files changed:
queue-4.19/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-4.19/series
queue-5.10/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-5.10/series
queue-5.15/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-5.15/series
queue-5.4/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-5.4/series
queue-6.1/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-6.1/series
queue-6.6/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-6.6/series
queue-6.7/hwmon-pc87360-bounds-check-data-innr-usage.patch [deleted file]
queue-6.7/series

diff --git a/queue-4.19/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-4.19/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index f891f30..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From c17402ef78ee304ee43c1ef233f373b0a2bfc7fd Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index 7e3697727537..d2b3137dccd4 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -1637,7 +1637,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index 294e3634253297fa921cf96fcdab041ff547c143..b9017157333e7a19ebcc243a14cc2fde7d1b5476 100644 (file)
@@ -104,7 +104,6 @@ media-stk1160-fixed-high-volume-of-stk1160_dbg-messa.patch
 media-rockchip-rga-fix-swizzling-for-rgb-formats.patch
 pci-add-intel_hda_arl-to-pci_ids.h.patch
 alsa-hda-intel-add-hda_arl-pci-id-support.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch
 ib-ipoib-fix-mcast-list-locking.patch
 media-ddbridge-fix-an-error-code-problem-in-ddb_prob.patch
diff --git a/queue-5.10/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-5.10/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index 11a4a91..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From 870b52ed1cd6d610437943c732fdf45c6396c6c6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index 94f4b8b4a2ba..0cf603c8c9f9 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -1605,7 +1605,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index 9574aade0ed50a0e43a8390993d29193dbc395e5..3382cfd970776b9cc60a08033aded8ce126dd376 100644 (file)
@@ -190,7 +190,6 @@ media-rockchip-rga-fix-swizzling-for-rgb-formats.patch
 pci-add-intel_hda_arl-to-pci_ids.h.patch
 alsa-hda-intel-add-hda_arl-pci-id-support.patch
 alsa-hda-intel-dspcfg-add-filters-for-arl-s-and-arl.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch
 ib-ipoib-fix-mcast-list-locking.patch
 media-ddbridge-fix-an-error-code-problem-in-ddb_prob.patch
diff --git a/queue-5.15/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-5.15/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index 742c9a8..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From 14c450decfcb10feeef89e8f1ce3493fcfd66c31 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index 6a9ba23cd302..3519f486f0b7 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -1605,7 +1605,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index f426474962c5887a3018747ceed01b484e57e540..265c3c39fc7b5c754ed4e83e473be7735c8ecad9 100644 (file)
@@ -227,7 +227,6 @@ pci-add-intel_hda_arl-to-pci_ids.h.patch
 alsa-hda-intel-add-hda_arl-pci-id-support.patch
 alsa-hda-intel-dspcfg-add-filters-for-arl-s-and-arl.patch
 media-rkisp1-drop-irqf_shared.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 f2fs-fix-to-tag-gcing-flag-on-page-during-block-migr.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch
 ib-ipoib-fix-mcast-list-locking.patch
diff --git a/queue-5.4/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-5.4/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index 445258b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From fdbba7c9106a4bbd4764380244b63b58ad4ffd4c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index 94f4b8b4a2ba..0cf603c8c9f9 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -1605,7 +1605,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index e65dc050ef39eca015163c13acdb52c68b67379f..6025eb6232268bff880ff984f48d110a5f74b94d 100644 (file)
@@ -129,7 +129,6 @@ media-stk1160-fixed-high-volume-of-stk1160_dbg-messa.patch
 media-rockchip-rga-fix-swizzling-for-rgb-formats.patch
 pci-add-intel_hda_arl-to-pci_ids.h.patch
 alsa-hda-intel-add-hda_arl-pci-id-support.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch
 ib-ipoib-fix-mcast-list-locking.patch
 media-ddbridge-fix-an-error-code-problem-in-ddb_prob.patch
diff --git a/queue-6.1/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-6.1/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index 0ad75a3..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From c1a102dbd47b6b5009605d0357a1314b95c3d9f3 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index a4adc8bd531f..534a6072036c 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -323,7 +323,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index 197f0506e37469465cd2a55274a2663f6256abf8..096906d1839b6217f7636c94959c5bb23417c862 100644 (file)
@@ -125,7 +125,6 @@ media-rkisp1-fix-irq-handler-return-values.patch
 media-rkisp1-store-irq-lines.patch
 media-rkisp1-fix-irq-disable-race-issue.patch
 hwmon-nct6775-fix-fan-speed-set-failure-in-automatic.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 f2fs-fix-to-tag-gcing-flag-on-page-during-block-migr.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch
 ib-ipoib-fix-mcast-list-locking.patch
diff --git a/queue-6.6/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-6.6/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index 0f4ce2b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From cd95b4c6be9f5e46a15a21ed918f92bac16f5295 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index a4adc8bd531f..534a6072036c 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -323,7 +323,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index 06d40215e4f4e37751b38002b3c152a3de4a126d..097f7de290268d438027e67081466c3cba5de04e 100644 (file)
@@ -183,7 +183,6 @@ media-rkisp1-store-irq-lines.patch
 media-rkisp1-fix-irq-disable-race-issue.patch
 media-rkisp1-resizer-stop-manual-allocation-of-v4l2_.patch
 hwmon-nct6775-fix-fan-speed-set-failure-in-automatic.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 hwmon-hp-wmi-sensors-fix-failure-to-load-on-elitedes.patch
 f2fs-fix-to-tag-gcing-flag-on-page-during-block-migr.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch
diff --git a/queue-6.7/hwmon-pc87360-bounds-check-data-innr-usage.patch b/queue-6.7/hwmon-pc87360-bounds-check-data-innr-usage.patch
deleted file mode 100644 (file)
index 1477c31..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From a95f1e068507bc2f9c5e28e60883f3408f93eaa6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Nov 2023 12:02:07 -0800
-Subject: hwmon: (pc87360) Bounds check data->innr usage
-
-From: Kees Cook <keescook@chromium.org>
-
-[ Upstream commit 4265eb062a7303e537ab3792ade31f424c3c5189 ]
-
-Without visibility into the initializers for data->innr, GCC suspects
-using it as an index could walk off the end of the various 14-element
-arrays in data. Perform an explicit clamp to the array size. Silences
-the following warning with GCC 12+:
-
-../drivers/hwmon/pc87360.c: In function 'pc87360_update_device':
-../drivers/hwmon/pc87360.c:341:49: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
-  341 |                                 data->in_max[i] = pc87360_read_value(data,
-      |                                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
-  342 |                                                   LD_IN, i,
-      |                                                   ~~~~~~~~~
-  343 |                                                   PC87365_REG_IN_MAX);
-      |                                                   ~~~~~~~~~~~~~~~~~~~
-../drivers/hwmon/pc87360.c:209:12: note: at offset 255 into destination object 'in_max' of size 14
-  209 |         u8 in_max[14];          /* Register value */
-      |            ^~~~~~
-
-Cc: Jim Cromie <jim.cromie@gmail.com>
-Cc: Jean Delvare <jdelvare@suse.com>
-Cc: Guenter Roeck <linux@roeck-us.net>
-Cc: linux-hwmon@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Link: https://lore.kernel.org/r/20231130200207.work.679-kees@kernel.org
-[groeck: Added comment into code clarifying context]
-Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/hwmon/pc87360.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
-index 926ea1fe133c..9e9681b2e8c5 100644
---- a/drivers/hwmon/pc87360.c
-+++ b/drivers/hwmon/pc87360.c
-@@ -323,7 +323,11 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
-               }
-               /* Voltages */
--              for (i = 0; i < data->innr; i++) {
-+              /*
-+               * The min() below does not have any practical meaning and is
-+               * only needed to silence a warning observed with gcc 12+.
-+               */
-+              for (i = 0; i < min(data->innr, ARRAY_SIZE(data->in)); i++) {
-                       data->in_status[i] = pc87360_read_value(data, LD_IN, i,
-                                            PC87365_REG_IN_STATUS);
-                       /* Clear bits */
--- 
-2.43.0
-
index bdf30cd12621357b481b4912056fc5b40bd95cba..1043fbe57ab67c25bf9f3b19fda0166ba46859ba 100644 (file)
@@ -198,7 +198,6 @@ media-rkisp1-store-irq-lines.patch
 media-rkisp1-fix-irq-disable-race-issue.patch
 media-rkisp1-resizer-stop-manual-allocation-of-v4l2_.patch
 hwmon-nct6775-fix-fan-speed-set-failure-in-automatic.patch
-hwmon-pc87360-bounds-check-data-innr-usage.patch
 hwmon-hp-wmi-sensors-fix-failure-to-load-on-elitedes.patch
 f2fs-fix-to-tag-gcing-flag-on-page-during-block-migr.patch
 drm-exynos-call-drm_atomic_helper_shutdown-at-shutdo.patch