All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/vma: Correct use after free in eviction
@ 2013-08-16 17:43 Ben Widawsky
  2013-08-16 20:29 ` [PATCH] [v2] " Ben Widawsky
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Widawsky @ 2013-08-16 17:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ben Widawsky, Ben Widawsky

The vma will [possibly] be destroyed during unbind in eviction.
Immediately after this, we try to delete the list entry.

Chris and Ville did the debug on this before I woke up, I just get to
take credit for the fix :p

Reported-by: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index 0cbaad4..db90261 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -139,10 +139,11 @@ found:
 		vma = list_first_entry(&eviction_list,
 				       struct i915_vma,
 				       exec_list);
+
+		list_del_init(&vma->exec_list);
 		if (ret == 0)
 			ret = i915_vma_unbind(vma);
 
-		list_del_init(&vma->exec_list);
 		drm_gem_object_unreference(&vma->obj->base);
 	}
 
-- 
1.8.3.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-19  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-16 17:43 [PATCH] drm/i915/vma: Correct use after free in eviction Ben Widawsky
2013-08-16 20:29 ` [PATCH] [v2] " Ben Widawsky
2013-08-16 22:31   ` Chris Wilson
2013-08-18 17:26     ` Daniel Vetter
2013-08-18 22:35       ` Ben Widawsky
2013-08-19  6:39         ` Daniel Vetter
2013-08-19  8:49           ` Mika Kuoppala
2013-08-19  9:01             ` Daniel Vetter

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.