[Intel-gfx] [PATCH] drm/i915: Prevent oops on req->engine in rcu-protected peeking
Chris Wilson
chris at chris-wilson.co.uk
Fri Aug 5 17:38:13 UTC 2016
On Fri, Aug 05, 2016 at 06:37:00PM +0200, Daniel Vetter wrote:
> When only rcu-protected we might peek at a reinitializing request.
> Prevent carnage by making sure we don't accidentally chase a NULL
> pointer.
>
> The proper fix for this is to drop the memset (with kzalloc) in the
> request allocation function, since that avoids both the NULL check in
> these fastpaths and makes request allocation a notch lighter. But it
> also means we need to careful audit all the paths to make sure nothing
> gets upset and runs into garbage. And that's a bit much on a late Friday
> with Joonas already on w/e. Also, today is drm-intel-next tag day, and
> this will be the tag for the first 4.9 pull request.
>
> Hence this easier to review interim fix, which will be replaced early next
> week by the proper fix Chris is working on.
>
> Fixes: 0eafec6d3244 ("drm/i915: Enable lockless lookup of request...")
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: "Goel, Akash" <akash.goel at intel.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
This is not complete either since we do RCU lookups elsewhere as well.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list