All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: daniel.vetter@intel.com, daniels@collabora.com,
	tomeu.vizoso@collabora.com
Subject: [PATCH i-g-t v3 3/7] tests/kms_ccs: Prevent segfault if pipe is not supported
Date: Thu, 31 Aug 2017 03:18:06 -0300	[thread overview]
Message-ID: <20170831061810.11773-4-krisman@collabora.co.uk> (raw)
In-Reply-To: <20170831061810.11773-1-krisman@collabora.co.uk>

for_each_plane_on_pipe() indexes bad memory when iterating over an invalid
pipe.  Make sure the pipe exists before trying to use it.  This prevents
the crash below:

root@ideacentre:~# igt-gpu-tools/tests/kms_ccs --r pipe-D-crc-sprite-planes-basic
IGT-Version: 1.19-g59f0e3d182a8 (x86_64) (Linux: 4.13.0-rc6.intel-boxes+x86_64)
Received signal SIGSEGV.
Stack trace:
 #0 [fatal_sig_handler+0x185]
 #1 [killpg+0x40]
 #2 [__real_main485+0x2de]
 #3 [main+0x3f]
 #4 [__libc_start_main+0xf1]
 #5 [_start+0x2a]
 #6 [<unknown>+0x2a]
Subtest pipe-D-crc-sprite-planes-basic: CRASH (0.004s)

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 tests/kms_ccs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 775c6999699f..73025a1e019f 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -503,6 +503,9 @@ igt_main
 
 		data.flags = TEST_CRC;
 		igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) {
+
+			igt_display_require_output_on_pipe(&data.display, data.pipe);
+
 			for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
 				if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
 					continue;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-08-31  6:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31  6:18 [PATCH i-g-t v3 0/7] kms_ccs testcase improvements Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 1/7] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 2/7] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
2017-08-31  7:06   ` Maarten Lankhorst
2017-08-31  7:08     ` Maarten Lankhorst
2017-08-31  6:18 ` Gabriel Krisman Bertazi [this message]
2017-08-31  6:18 ` [PATCH i-g-t v3 4/7] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 5/7] tests/kms_ccs: Test case where CCS and main buffer overlaps Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 6/7] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
2017-08-31  6:18 ` [PATCH i-g-t v3 7/7] tests/kms_ccs: Test case for wrong aux buffer stripe size Gabriel Krisman Bertazi
2017-09-05  8:03   ` Daniel Stone
2017-08-31 12:47 ` ✓ Fi.CI.BAT: success for kms_ccs testcase improvements Patchwork
2017-08-31 18:28 ` ✓ Fi.CI.IGT: " 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=20170831061810.11773-4-krisman@collabora.co.uk \
    --to=krisman@collabora.co.uk \
    --cc=daniel.vetter@intel.com \
    --cc=daniels@collabora.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tomeu.vizoso@collabora.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.