ANDROID: fix dmabuf accounting deadlock issue
dmabu accounting code uses two main locks: dmabuf_rec_reloads.lock to control access to dmabuf record preloads and dmabuf_info->lock to control access to dmabuf_info fields. If both these locks should be held then the locking order should always be dmabuf_rec_reloads.lock first and then dmabuf_info->lock. However dma_buf_unaccount_task() violates this rule by taking dmabuf_info->lock and then locking dmabuf_rec_reloads.lock indirectly via free_task_dmabuf_record() call. This can result in a deadlock. Fix it by calling free_task_dmabuf_record() after dmabuf_info->lock is released. Bug: 434747237 Bug: 424646615 Signed-off-by:Suren Baghdasaryan <surenb@google.com> (cherry picked from https://android-review.googlesource.com/q/commit:9ec6dc688114d8fbbb14f494b72001fd9d760178) Merged-In: Ie4bead2b1952659e0009441cff95b26fed7267f8 Change-Id: Ie4bead2b1952659e0009441cff95b26fed7267f8 Bug: 434752769
Loading
Please sign in to comment