* [PATCH] drm/i915: Fix use-after-free of context during free_contexts
@ 2017-06-30 23:05 Chris Wilson
2017-06-30 23:23 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-30 23:42 ` [PATCH] " Matthew Auld
0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-06-30 23:05 UTC (permalink / raw)
To: intel-gfx; +Cc: Matthew Auld
When iterating the list of contexts to free, we need to use a safe
iterator as we are freeing the link as we go. Pass an extra thick brown
paper bag.
Fixes: 5f09a9c8ab6b ("drm/i915: Allow contexts to be unreferenced locklessly")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
---
drivers/gpu/drm/i915/i915_gem_context.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 71d2ea7dab64..2eb5d8203999 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -193,11 +193,11 @@ static void i915_gem_context_free(struct i915_gem_context *ctx)
static void contexts_free(struct drm_i915_private *i915)
{
struct llist_node *freed = llist_del_all(&i915->contexts.free_list);
- struct i915_gem_context *ctx;
+ struct i915_gem_context *ctx, *cn;
lockdep_assert_held(&i915->drm.struct_mutex);
- llist_for_each_entry(ctx, freed, free_link)
+ llist_for_each_entry_safe(ctx, cn, freed, free_link)
i915_gem_context_free(ctx);
}
--
2.13.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: Fix use-after-free of context during free_contexts
2017-06-30 23:05 [PATCH] drm/i915: Fix use-after-free of context during free_contexts Chris Wilson
@ 2017-06-30 23:23 ` Patchwork
2017-06-30 23:42 ` [PATCH] " Matthew Auld
1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-06-30 23:23 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Fix use-after-free of context during free_contexts
URL : https://patchwork.freedesktop.org/series/26671/
State : success
== Summary ==
Series 26671v1 drm/i915: Fix use-after-free of context during free_contexts
https://patchwork.freedesktop.org/api/1.0/series/26671/revisions/1/mbox/
Test kms_pipe_crc_basic:
Subgroup hang-read-crc-pipe-a:
dmesg-warn -> PASS (fi-pnv-d510) fdo#101597
fdo#101597 https://bugs.freedesktop.org/show_bug.cgi?id=101597
fi-bdw-5557u total:279 pass:264 dwarn:0 dfail:0 fail:3 skip:11 time:435s
fi-bdw-gvtdvm total:279 pass:257 dwarn:8 dfail:0 fail:0 skip:14 time:427s
fi-blb-e6850 total:279 pass:224 dwarn:1 dfail:0 fail:0 skip:54 time:354s
fi-bsw-n3050 total:279 pass:239 dwarn:0 dfail:0 fail:3 skip:36 time:520s
fi-bxt-j4205 total:279 pass:256 dwarn:0 dfail:0 fail:3 skip:19 time:498s
fi-byt-j1900 total:279 pass:251 dwarn:0 dfail:0 fail:3 skip:24 time:477s
fi-byt-n2820 total:279 pass:246 dwarn:1 dfail:0 fail:3 skip:28 time:488s
fi-glk-2a total:279 pass:256 dwarn:0 dfail:0 fail:3 skip:19 time:584s
fi-hsw-4770 total:279 pass:259 dwarn:0 dfail:0 fail:3 skip:16 time:433s
fi-hsw-4770r total:279 pass:259 dwarn:0 dfail:0 fail:3 skip:16 time:409s
fi-ilk-650 total:279 pass:225 dwarn:0 dfail:0 fail:3 skip:50 time:414s
fi-ivb-3520m total:279 pass:257 dwarn:0 dfail:0 fail:3 skip:18 time:492s
fi-ivb-3770 total:279 pass:257 dwarn:0 dfail:0 fail:3 skip:18 time:463s
fi-kbl-7500u total:279 pass:257 dwarn:0 dfail:0 fail:3 skip:18 time:468s
fi-kbl-7560u total:279 pass:264 dwarn:1 dfail:0 fail:3 skip:10 time:556s
fi-kbl-r total:279 pass:256 dwarn:1 dfail:0 fail:3 skip:18 time:566s
fi-pnv-d510 total:279 pass:222 dwarn:2 dfail:0 fail:0 skip:55 time:560s
fi-skl-6260u total:279 pass:265 dwarn:0 dfail:0 fail:3 skip:10 time:451s
fi-skl-6700k total:279 pass:257 dwarn:0 dfail:0 fail:3 skip:18 time:459s
fi-skl-6770hq total:279 pass:265 dwarn:0 dfail:0 fail:3 skip:10 time:473s
fi-skl-gvtdvm total:279 pass:266 dwarn:0 dfail:0 fail:0 skip:13 time:435s
fi-snb-2520m total:279 pass:247 dwarn:0 dfail:0 fail:3 skip:28 time:550s
fi-snb-2600 total:279 pass:246 dwarn:0 dfail:0 fail:3 skip:29 time:403s
6412bcb8e279d62b9d8ae2840712d6c85806369b drm-tip: 2017y-06m-30d-14h-56m-41s UTC integration manifest
14eda1f drm/i915: Fix use-after-free of context during free_contexts
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_5085/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Fix use-after-free of context during free_contexts
2017-06-30 23:05 [PATCH] drm/i915: Fix use-after-free of context during free_contexts Chris Wilson
2017-06-30 23:23 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-06-30 23:42 ` Matthew Auld
2017-07-04 10:57 ` Chris Wilson
1 sibling, 1 reply; 4+ messages in thread
From: Matthew Auld @ 2017-06-30 23:42 UTC (permalink / raw)
To: Chris Wilson; +Cc: Intel Graphics Development, Matthew Auld
On 1 July 2017 at 00:05, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> When iterating the list of contexts to free, we need to use a safe
> iterator as we are freeing the link as we go. Pass an extra thick brown
> paper bag.
>
> Fixes: 5f09a9c8ab6b ("drm/i915: Allow contexts to be unreferenced locklessly")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915: Fix use-after-free of context during free_contexts
2017-06-30 23:42 ` [PATCH] " Matthew Auld
@ 2017-07-04 10:57 ` Chris Wilson
0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-07-04 10:57 UTC (permalink / raw)
To: Matthew Auld; +Cc: Intel Graphics Development, Matthew Auld
Quoting Matthew Auld (2017-07-01 00:42:35)
> On 1 July 2017 at 00:05, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > When iterating the list of contexts to free, we need to use a safe
> > iterator as we are freeing the link as we go. Pass an extra thick brown
> > paper bag.
> >
> > Fixes: 5f09a9c8ab6b ("drm/i915: Allow contexts to be unreferenced locklessly")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Cc: Matthew Auld <matthew.auld@intel.com>
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Thanks for the review, pushed.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-04 10:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 23:05 [PATCH] drm/i915: Fix use-after-free of context during free_contexts Chris Wilson
2017-06-30 23:23 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-30 23:42 ` [PATCH] " Matthew Auld
2017-07-04 10:57 ` Chris Wilson
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.