From 5f3893e478cb6cede5f59e4e97ca7b31c0fe4d30 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 9 Jan 2025 11:34:39 +0100 Subject: [PATCH] drop queue-5.10/drm-modes-avoid-divide-by-zero-harder-in-drm_mode_vrefresh.patch adds build warnings :( --- ...-by-zero-harder-in-drm_mode_vrefresh.patch | 58 ------------------- queue-5.10/series | 1 - 2 files changed, 59 deletions(-) delete mode 100644 queue-5.10/drm-modes-avoid-divide-by-zero-harder-in-drm_mode_vrefresh.patch diff --git a/queue-5.10/drm-modes-avoid-divide-by-zero-harder-in-drm_mode_vrefresh.patch b/queue-5.10/drm-modes-avoid-divide-by-zero-harder-in-drm_mode_vrefresh.patch deleted file mode 100644 index ec9d1d8f117..00000000000 --- a/queue-5.10/drm-modes-avoid-divide-by-zero-harder-in-drm_mode_vrefresh.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 9398332f23fab10c5ec57c168b44e72997d6318e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= -Date: Fri, 29 Nov 2024 06:26:28 +0200 -Subject: drm/modes: Avoid divide by zero harder in drm_mode_vrefresh() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ville Syrjälä - -commit 9398332f23fab10c5ec57c168b44e72997d6318e upstream. - -drm_mode_vrefresh() is trying to avoid divide by zero -by checking whether htotal or vtotal are zero. But we may -still end up with a div-by-zero of vtotal*htotal*... - -Cc: stable@vger.kernel.org -Reported-by: syzbot+622bba18029bcde672e1@syzkaller.appspotmail.com -Closes: https://syzkaller.appspot.com/bug?extid=622bba18029bcde672e1 -Signed-off-by: Ville Syrjälä -Link: https://patchwork.freedesktop.org/patch/msgid/20241129042629.18280-2-ville.syrjala@linux.intel.com -Reviewed-by: Jani Nikula -Signed-off-by: Greg Kroah-Hartman ---- - drivers/gpu/drm/drm_modes.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - ---- a/drivers/gpu/drm/drm_modes.c -+++ b/drivers/gpu/drm/drm_modes.c -@@ -757,14 +757,11 @@ EXPORT_SYMBOL(drm_mode_set_name); - */ - int drm_mode_vrefresh(const struct drm_display_mode *mode) - { -- unsigned int num, den; -+ unsigned int num = 1, den = 1; - - if (mode->htotal == 0 || mode->vtotal == 0) - return 0; - -- num = mode->clock; -- den = mode->htotal * mode->vtotal; -- - if (mode->flags & DRM_MODE_FLAG_INTERLACE) - num *= 2; - if (mode->flags & DRM_MODE_FLAG_DBLSCAN) -@@ -772,6 +769,12 @@ int drm_mode_vrefresh(const struct drm_d - if (mode->vscan > 1) - den *= mode->vscan; - -+ if (check_mul_overflow(mode->clock, num, &num)) -+ return 0; -+ -+ if (check_mul_overflow(mode->htotal * mode->vtotal, den, &den)) -+ return 0; -+ - return DIV_ROUND_CLOSEST_ULL(mul_u32_u32(num, 1000), den); - } - EXPORT_SYMBOL(drm_mode_vrefresh); diff --git a/queue-5.10/series b/queue-5.10/series index 7d57bd969c5..0bf70e763b5 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -27,7 +27,6 @@ usb-serial-option-add-meig-smart-slm770a.patch usb-serial-option-add-netprisma-lcuk54-modules-for-wwan-ready.patch usb-serial-option-add-mediatek-t7xx-compositions.patch usb-serial-option-add-telit-fe910c04-rmnet-compositions.patch -drm-modes-avoid-divide-by-zero-harder-in-drm_mode_vrefresh.patch hwmon-tmp513-fix-interpretation-of-values-of-tempera.patch sh-clk-fix-clk_enable-to-return-0-on-null-clk.patch zram-refuse-to-use-zero-sized-block-device-as-backing-device.patch -- 2.47.3