Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCHv2] drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get()
@ 2024-12-12  9:50 Karol Przybylski
  2024-12-12  9:52 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Karol Przybylski @ 2024-12-12  9:50 UTC (permalink / raw)
  To: karprzy7, laurent.pinchart, tomi.valkeinen, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, michal.simek
  Cc: dri-devel, linux-arm-kernel, linux-kernel, stable

This patch fixes a potential integer overflow in the zynqmp_dp_rate_get()

The issue comes up when the expression
drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000 is evaluated using 32-bit
Now the constant is a compatible 64-bit type.

Resolves coverity issues: CID 1636340 and CID 1635811

Signed-off-by: Karol Przybylski <karprzy7@gmail.com>
Fixes: 28edaacb821c6 ("drm: zynqmp_dp: Add debugfs interface for compliance testing")
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index 25c5dc61e..56a261a40 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -2190,7 +2190,7 @@ static int zynqmp_dp_rate_get(void *data, u64 *val)
 	struct zynqmp_dp *dp = data;
 
 	mutex_lock(&dp->lock);
-	*val = drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000;
+	*val = drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000ULL;
 	mutex_unlock(&dp->lock);
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2] drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get()
  2024-12-12  9:50 [PATCHv2] drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get() Karol Przybylski
@ 2024-12-12  9:52 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-12  9:52 UTC (permalink / raw)
  To: Karol Przybylski; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCHv2] drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get()
Link: https://lore.kernel.org/stable/20241212095057.1015146-1-karprzy7%40gmail.com

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-12  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12  9:50 [PATCHv2] drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get() Karol Przybylski
2024-12-12  9:52 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox