Skip to contentSkip to conversation

sna: Fix double-free crashes.

PATCH In review Alexei Podtelezhnikov 3 participants 4 messages Apr 8, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sna: Fix double-free crashes.

Fix double-free crashes.
See https://bugzilla.redhat.com/show_bug.cgi?id=1808767

---
 src/sna/kgem.c | 3 +++
 1 file changed, 3 insertions(+)
src/sna/kgem.c +3 -0
index 6a35067c..76bb1599 100644
@@ -3079,6 +3079,9 @@ static void kgem_buffer_release(struct kgem *kgem, struct kgem_buffer *bo)
 		assert(cached != &bo->base);
 		list_del(&cached->vma);
 
+		if (!cached->map__gtt)
+			continue;
+
 		assert(*(struct kgem_bo **)cached->map__gtt == cached);
 		*(struct kgem_bo **)cached->map__gtt = NULL;
 		cached->map__gtt = NULL;
Signature · 6 lines
2.26.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for sna: Fix double-free crashes.

== Series Details ==

== Series Details ==

Series: sna: Fix double-free crashes.
URL : https://patchwork.freedesktop.org/series/75647/
State : failure

== Summary ==

Applying: sna: Fix double-free crashes.
error: sha1 information is lacking or useless (src/sna/kgem.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 sna: Fix double-free crashes.
When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 7 lines
Quoted 4 lines

Fix double-free crashes.
See https://bugzilla.redhat.com/show_bug.cgi?id=1808767

It should be impossible to get here, so this is just papering over a bug.

You sound certain that locking is airtight and pthread.so just happened to be there. The crashes are quite random but seem to need memory shortage. Please also try while I am working on a full debug.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx