From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Konduru, Chandra" <chandra.konduru@intel.com>,
"Intel-gfx@lists.freedesktop.org"
<Intel-gfx@lists.freedesktop.org>
Cc: "Wood, Thomas" <thomas.wood@intel.com>
Subject: Re: [PATCH v2 i-g-t 1/4] igt_kms: Avoid NULL ptr deref when commiting disabled planes
Date: Thu, 07 May 2015 10:00:40 +0100 [thread overview]
Message-ID: <554B29B8.8020004@linux.intel.com> (raw)
In-Reply-To: <76A9B330A4D78C4D99CB292C4CC06C0E36FC745A@fmsmsx101.amr.corp.intel.com>
On 05/06/2015 09:47 PM, Konduru, Chandra wrote:
>> -----Original Message-----
>> From: Tvrtko Ursulin [mailto:tvrtko.ursulin@linux.intel.com]
>> Sent: Tuesday, May 05, 2015 2:53 AM
>> To: Intel-gfx@lists.freedesktop.org
>> Cc: Ursulin, Tvrtko; Konduru, Chandra; Wood, Thomas
>> Subject: [PATCH v2 i-g-t 1/4] igt_kms: Avoid NULL ptr deref when commiting
>> disabled planes
>>
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> I think;
>>
>> commit a26f9f9ad0e679c7ce413a25d34f6914e1174151
>> Author: chandra konduru <chandra.konduru@intel.com>
>> Date: Mon Mar 30 13:52:04 2015 -0700
>>
>> i-g-t: Adding plane scaling test case
>>
>> introduced a condition where it attempts to update a disabled plane because of
>> the newly introduced size_changed flag which is set for disabled frame buffers.
>> Result is a NULL ptr deref in igt_drm_plane_commit (plane->fb->src_x).
>>
>> Start recognising this case as disabled plane and act accordingly.
>>
>> v2: Split out igt_plane_set_fb cleanup. (Thomas Wood)
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Cc: chandra konduru <chandra.konduru@intel.com>
>> Cc: Thomas Wood <thomas.wood@intel.com>
>> ---
>> There might be a better fix, but this works for me.
>> ---
>> lib/igt_kms.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/igt_kms.c b/lib/igt_kms.c index b7d1e90..33d437d 100644
>> --- a/lib/igt_kms.c
>> +++ b/lib/igt_kms.c
>> @@ -1331,7 +1331,7 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
>> fb_id = igt_plane_get_fb_id(plane);
>> crtc_id = output->config.crtc->crtc_id;
>>
>> - if (plane->fb_changed && fb_id == 0) {
>> + if ((plane->fb_changed || plane->size_changed) && fb_id == 0) {
>
> Shouldn't this include plane->position_changed too? Like:
> if ((plane->fb_changed || plane->size_changed || plane->position_changed) && fb_id == 0) {
When you added size_changed, state for position_changed and fb == NULL
remained the same, while size_changed added new state for size_changed
== true and fb == NULL. So I added handling for that and did not think
much beyond it. It fixes a segfault so I moved on. Or in other words, I
don't see how it would harm to merge this, it doesn't make anything worse.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-05-07 9:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 9:53 [PATCH v2 i-g-t 1/4] igt_kms: Avoid NULL ptr deref when commiting disabled planes Tvrtko Ursulin
2015-05-05 9:53 ` [PATCH i-g-t 2/4] igt_kms: Merge condition in igt_plane_set_fb Tvrtko Ursulin
2015-05-06 20:56 ` Konduru, Chandra
2015-05-07 9:06 ` Tvrtko Ursulin
2015-05-05 9:53 ` [PATCH i-g-t 3/4] igt_kms: Do not reset plane position on assigning a fb Tvrtko Ursulin
2015-05-06 19:02 ` Konduru, Chandra
2015-05-07 9:15 ` Tvrtko Ursulin
2015-05-08 0:03 ` Konduru, Chandra
2015-05-08 8:36 ` Tvrtko Ursulin
2015-05-08 17:57 ` Konduru, Chandra
2015-05-05 9:53 ` [PATCH i-g-t 4/4] kms_plane_scaling: Find the image regardless how the test is run Tvrtko Ursulin
2015-05-05 17:22 ` Konduru, Chandra
2015-05-06 9:29 ` Tvrtko Ursulin
2015-05-06 18:17 ` Konduru, Chandra
2015-05-07 8:54 ` Tvrtko Ursulin
2015-05-06 20:47 ` [PATCH v2 i-g-t 1/4] igt_kms: Avoid NULL ptr deref when commiting disabled planes Konduru, Chandra
2015-05-07 9:00 ` Tvrtko Ursulin [this message]
2015-05-07 23:45 ` Konduru, Chandra
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=554B29B8.8020004@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chandra.konduru@intel.com \
--cc=thomas.wood@intel.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