From: Ben Widawsky <ben@bwidawsk.net>
To: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Cc: daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org,
tomeu.vizoso@collabora.com
Subject: Re: [PATCH i-g-t v4 3/6] tests/kms_ccs: Prevent segfault if pipe is not supported
Date: Tue, 3 Oct 2017 09:07:16 -0700 [thread overview]
Message-ID: <20171003160716.GA19707@mail.bwidawsk.net> (raw)
In-Reply-To: <20170927183419.13904-3-krisman@collabora.co.uk>
On 17-09-27 15:34:16, Gabriel Krisman Bertazi wrote:
>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>
1-3 so far are
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
>---
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-03 16:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 18:34 [PATCH i-g-t v4 1/6] tests/kms_ccs: Test pipes other than pipe A Gabriel Krisman Bertazi
2017-09-27 18:34 ` [PATCH i-g-t v4 2/6] lib/igt_kms: Fix off-by-one bug on skip of missing pipe Gabriel Krisman Bertazi
2017-09-28 8:33 ` Petri Latvala
2017-09-27 18:34 ` [PATCH i-g-t v4 3/6] tests/kms_ccs: Prevent segfault if pipe is not supported Gabriel Krisman Bertazi
2017-10-03 10:49 ` Arkadiusz Hiler
2017-10-03 16:07 ` Ben Widawsky [this message]
2017-09-27 18:34 ` [PATCH i-g-t v4 4/6] tests/kms_ccs: Test case where the CCS buffer was not provided Gabriel Krisman Bertazi
2017-10-03 11:32 ` Arkadiusz Hiler
2017-10-03 16:35 ` Ben Widawsky
2017-10-09 6:14 ` Gabriel Krisman Bertazi
2017-10-30 16:02 ` Ville Syrjälä
2017-10-31 1:33 ` Gabriel Krisman Bertazi
2017-09-27 18:34 ` [PATCH i-g-t v4 5/6] tests/kms_ccs: Test case where CCS is on a different BO Gabriel Krisman Bertazi
2017-10-03 11:00 ` Arkadiusz Hiler
2017-10-03 16:38 ` Ben Widawsky
2017-10-09 6:18 ` Gabriel Krisman Bertazi
2017-09-27 18:34 ` [PATCH i-g-t v4 6/6] tests/kms_ccs: Test case for wrong aux buffer stride size Gabriel Krisman Bertazi
2017-10-03 10:57 ` Arkadiusz Hiler
2017-10-30 15:59 ` Ville Syrjälä
2017-10-03 16:40 ` Ben Widawsky
2017-10-09 6:03 ` Gabriel Krisman Bertazi
2017-10-30 16:04 ` Ville Syrjälä
2017-09-27 18:58 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/6] tests/kms_ccs: Test pipes other than pipe A Patchwork
2017-09-27 23:42 ` ✗ Fi.CI.IGT: failure " Patchwork
2017-09-28 16:06 ` Patchwork
2017-10-03 10:44 ` [PATCH i-g-t v4 1/6] " Arkadiusz Hiler
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=20171003160716.GA19707@mail.bwidawsk.net \
--to=ben@bwidawsk.net \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=krisman@collabora.co.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox