Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh()
@ 2024-11-27 11:00 Ville Syrjala
  2024-11-27 13:43 ` ✗ GitLab.Pipeline: warning for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Ville Syrjala @ 2024-11-27 11:00 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Add a new subtest which attempts to invoke a div-by-zero via
an overflow in drm_mode_vrefresh() (found by syzbot).

Link: https://syzkaller.appspot.com/bug?extid=622bba18029bcde672e1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_invalid_mode.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index 4fd644594ef9..5fa85338c799 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -210,6 +210,20 @@ adjust_mode_bad_vtotal(data_t *data, drmModeModeInfoPtr mode)
 	return true;
 }
 
+static bool
+adjust_mode_overflow_vrefresh(data_t *data, drmModeModeInfoPtr mode)
+{
+	/*
+	 * htotal * vtotal * vscan == 2^32
+	 * overflow during vrefresh calculation
+	 */
+	mode->htotal = 32768;
+	mode->vtotal = 32768;
+	mode->vscan = 4;
+
+	return true;
+}
+
 static void
 test_output(data_t *data)
 {
@@ -285,6 +299,9 @@ static const struct {
 	{ .name = "bad-vtotal",
 	  .adjust_mode = adjust_mode_bad_vtotal,
 	},
+	{ .name = "overflow-vrefresh",
+	  .adjust_mode = adjust_mode_overflow_vrefresh,
+	},
 };
 
 static data_t data;
-- 
2.45.2


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

end of thread, other threads:[~2024-11-29  7:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 11:00 [PATCH i-g-t] tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh() Ville Syrjala
2024-11-27 13:43 ` ✗ GitLab.Pipeline: warning for " Patchwork
2024-11-28 19:09 ` [PATCH i-g-t v2] " Ville Syrjala
2024-11-29  3:46   ` Nautiyal, Ankit K
2024-11-28 20:52 ` ✓ i915.CI.BAT: success for tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh() (rev2) Patchwork
2024-11-28 20:59 ` ✓ Xe.CI.BAT: " Patchwork
2024-11-29  1:11 ` ✗ i915.CI.Full: failure " Patchwork
2024-11-29  3:45 ` [PATCH i-g-t] tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh() Nautiyal, Ankit K
2024-11-29  7:47 ` ✗ Xe.CI.Full: failure for tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh() (rev2) Patchwork

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