Skip to content

Commit 444fa5b

Browse files
dliviustevenprice-arm
authored andcommitted
drm/panthor: Lock XArray when getting entries for the VM
Similar to commit cac0757 ("drm/panthor: Fix race when converting group handle to group object") we need to use the XArray's internal locking when retrieving a vm pointer from there. v2: Removed part of the patch that was trying to protect fetching the heap pointer from XArray, as that operation is protected by the @pool->lock. Fixes: 647810e ("drm/panthor: Add the MMU/VM logical block") Reported-by: Jann Horn <jannh@google.com> Cc: stable@vger.kernel.org Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241106185806.389089-1-liviu.dudau@arm.com
1 parent 052ef64 commit 444fa5b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/panthor/panthor_mmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,9 @@ panthor_vm_pool_get_vm(struct panthor_vm_pool *pool, u32 handle)
15801580
{
15811581
struct panthor_vm *vm;
15821582

1583+
xa_lock(&pool->xa);
15831584
vm = panthor_vm_get(xa_load(&pool->xa, handle));
1585+
xa_unlock(&pool->xa);
15841586

15851587
return vm;
15861588
}

0 commit comments

Comments
 (0)