mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-16 01:08:05 +02:00
nouveau: fix crash during fence emission
Fence emission can flush the push buffer, which through flush_notify
unreferences recently emitted fence. If ref count is increased after
fence emission, unreference deletes the fence, which causes SIGSEGV.
Backtrace:
nouveau_fence_del
nouveau_fence_ref
nouveau_fence_next
nouveau_pushbuf_flush
MARK_RING
nv50_screen_fence_emit
nouveau_fence_emit
nv50_flush
This bug manifested as an assertion failure in nouveau_fence.c, because
SIGSEGV handler tried to shutdown the application and used messed up
fence.
This issue was reported by Maxim Levitsky.
(commit e1e03ce492 in master)
This commit is contained in:
parent
b9cc9166cf
commit
8d1f1eae93
1 changed files with 2 additions and 2 deletions
|
|
@ -93,8 +93,6 @@ nouveau_fence_emit(struct nouveau_fence *fence)
|
|||
/* set this now, so that if fence.emit triggers a flush we don't recurse */
|
||||
fence->state = NOUVEAU_FENCE_STATE_EMITTED;
|
||||
|
||||
screen->fence.emit(&screen->base, fence->sequence);
|
||||
|
||||
++fence->ref;
|
||||
|
||||
if (screen->fence.tail)
|
||||
|
|
@ -103,6 +101,8 @@ nouveau_fence_emit(struct nouveau_fence *fence)
|
|||
screen->fence.head = fence;
|
||||
|
||||
screen->fence.tail = fence;
|
||||
|
||||
screen->fence.emit(&screen->base, fence->sequence);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue