* [PATCH] drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info
@ 2014-04-30 7:30 Chris Wilson
2014-04-30 7:37 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2014-04-30 7:30 UTC (permalink / raw)
To: intel-gfx
In commit 691e6415c891b8b2b082a120b896b443531c4d45
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Apr 9 09:07:36 2014 +0100
drm/i915: Always use kref tracking for all contexts.
we populated fake contexts on all platforms. These were identical to the
full hardware context tracking structs, except for the ctx->obj used to
store the hardware state. However, there remained one place where we
assumed that if a context existed, it would have an object associated
with it.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77717
Testcase: igt/drv_suspend/debugfs-reader
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3c066e635022..9f50675c327a 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1796,6 +1796,9 @@ static int i915_context_status(struct seq_file *m, void *unused)
}
list_for_each_entry(ctx, &dev_priv->context_list, link) {
+ if (ctx->obj == NULL)
+ continue;
+
seq_puts(m, "HW context ");
describe_ctx(m, ctx);
for_each_ring(ring, dev_priv, i)
--
2.0.0.rc0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info
2014-04-30 7:30 [PATCH] drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info Chris Wilson
@ 2014-04-30 7:37 ` Daniel Vetter
2014-04-30 11:00 ` Jani Nikula
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2014-04-30 7:37 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Wed, Apr 30, 2014 at 08:30:00AM +0100, Chris Wilson wrote:
> In commit 691e6415c891b8b2b082a120b896b443531c4d45
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date: Wed Apr 9 09:07:36 2014 +0100
>
> drm/i915: Always use kref tracking for all contexts.
>
> we populated fake contexts on all platforms. These were identical to the
> full hardware context tracking structs, except for the ctx->obj used to
> store the hardware state. However, there remained one place where we
> assumed that if a context existed, it would have an object associated
> with it.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77717
> Testcase: igt/drv_suspend/debugfs-reader
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Queued for -next, thanks for the patch.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 3c066e635022..9f50675c327a 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1796,6 +1796,9 @@ static int i915_context_status(struct seq_file *m, void *unused)
> }
>
> list_for_each_entry(ctx, &dev_priv->context_list, link) {
> + if (ctx->obj == NULL)
> + continue;
> +
> seq_puts(m, "HW context ");
> describe_ctx(m, ctx);
> for_each_ring(ring, dev_priv, i)
> --
> 2.0.0.rc0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info
2014-04-30 7:37 ` Daniel Vetter
@ 2014-04-30 11:00 ` Jani Nikula
2014-04-30 12:40 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2014-04-30 11:00 UTC (permalink / raw)
To: Daniel Vetter, Chris Wilson; +Cc: intel-gfx
On Wed, 30 Apr 2014, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Apr 30, 2014 at 08:30:00AM +0100, Chris Wilson wrote:
>> In commit 691e6415c891b8b2b082a120b896b443531c4d45
>> Author: Chris Wilson <chris@chris-wilson.co.uk>
>> Date: Wed Apr 9 09:07:36 2014 +0100
>>
>> drm/i915: Always use kref tracking for all contexts.
>>
>> we populated fake contexts on all platforms. These were identical to the
>> full hardware context tracking structs, except for the ctx->obj used to
>> store the hardware state. However, there remained one place where we
>> assumed that if a context existed, it would have an object associated
>> with it.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77717
>> Testcase: igt/drv_suspend/debugfs-reader
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> Queued for -next, thanks for the patch.
Why not -fixes? "drm/i915: Always use kref tracking for all contexts" is
present in v3.15-rc2.
Jani.
> -Daniel
>
>> ---
>> drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
>> index 3c066e635022..9f50675c327a 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -1796,6 +1796,9 @@ static int i915_context_status(struct seq_file *m, void *unused)
>> }
>>
>> list_for_each_entry(ctx, &dev_priv->context_list, link) {
>> + if (ctx->obj == NULL)
>> + continue;
>> +
>> seq_puts(m, "HW context ");
>> describe_ctx(m, ctx);
>> for_each_ring(ring, dev_priv, i)
>> --
>> 2.0.0.rc0
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info
2014-04-30 11:00 ` Jani Nikula
@ 2014-04-30 12:40 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-04-30 12:40 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Wed, Apr 30, 2014 at 02:00:16PM +0300, Jani Nikula wrote:
> On Wed, 30 Apr 2014, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Apr 30, 2014 at 08:30:00AM +0100, Chris Wilson wrote:
> >> In commit 691e6415c891b8b2b082a120b896b443531c4d45
> >> Author: Chris Wilson <chris@chris-wilson.co.uk>
> >> Date: Wed Apr 9 09:07:36 2014 +0100
> >>
> >> drm/i915: Always use kref tracking for all contexts.
> >>
> >> we populated fake contexts on all platforms. These were identical to the
> >> full hardware context tracking structs, except for the ctx->obj used to
> >> store the hardware state. However, there remained one place where we
> >> assumed that if a context existed, it would have an object associated
> >> with it.
> >>
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77717
> >> Testcase: igt/drv_suspend/debugfs-reader
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >
> > Queued for -next, thanks for the patch.
>
> Why not -fixes? "drm/i915: Always use kref tracking for all contexts" is
> present in v3.15-rc2.
I guess we could merge it to -fixes, otoh this is for debugfs ... Dunno
whether we should throw this at grumpy Linus really.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-30 12:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-30 7:30 [PATCH] drm/i915: Avoid NULL ctx->obj dereference in debugfs/i915_context_info Chris Wilson
2014-04-30 7:37 ` Daniel Vetter
2014-04-30 11:00 ` Jani Nikula
2014-04-30 12:40 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox