On 02/12/2026 23:33, Matthew Brost wrote:
xe_bo_apply_to_pinned() drops xe->pinned.lock before invoking the callback with only a bo reference held. Unlike the other pinned callbacks, xe_bo_dma_unmap_pinned() does not take the bo's dma-resv lock, so on device removal it can race with an importer unpinning an exported bo (xe_bo_unpin_external()) followed by an eviction that unmaps the same tt, resulting in a double DMA unmap and sg table free. The imported-bo branch also calls dma_buf_unmap_sgt(), which asserts that the dma-resv lock is held.Take the bo lock around the unmap. Fixes: 3cbb651117ff ("drm/xe/bo: Add a bo remove callback") Cc: Thomas Hellström <[email protected]> Cc: Matthew Auld <[email protected]> Cc: [email protected] # v6.16+ Signed-off-by: Matthew Brost <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
