[PATCH] drm/amdgpu: set bulk_moveable to false when a per VM is released
Christian König
christian.koenig at amd.com
Wed Sep 5 15:09:31 UTC 2018
Hi Tom,
please check if that patch helps with your KASAN problem.
Thanks,
Christian.
Am 05.09.2018 um 17:08 schrieb Christian König:
> Otherwise we might run into a use after free during bulk move.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index ea5e277ae038..ed1e6abda391 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -2513,8 +2513,12 @@ void amdgpu_vm_bo_rmv(struct amdgpu_device *adev,
> struct amdgpu_bo_va *bo_va)
> {
> struct amdgpu_bo_va_mapping *mapping, *next;
> + struct amdgpu_bo *bo = bo_va->base.bo;
> struct amdgpu_vm *vm = bo_va->base.vm;
>
> + if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv)
> + vm->bulk_moveable = false;
> +
> list_del(&bo_va->base.bo_list);
>
> spin_lock(&vm->invalidated_lock);
More information about the amd-gfx
mailing list