Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t] tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh()
Date: Wed, 27 Nov 2024 13:00:12 +0200	[thread overview]
Message-ID: <20241127110012.13349-1-ville.syrjala@linux.intel.com> (raw)

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


             reply	other threads:[~2024-11-27 11:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27 11:00 Ville Syrjala [this message]
2024-11-27 13:43 ` ✗ GitLab.Pipeline: warning for tests/kms_invalid_mode: Attempt divide-by-zero in drm_mode_vrefresh() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241127110012.13349-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox