Skip to content

Commit b993999

Browse files
prliangpubgregkh
authored andcommitted
drm/amdgpu/userq: assign an error code for invalid userq va
commit 883bd89d00085c2c5f1efcd25861745cb039f9e3 upstream. It should return an error code if userq VA validation fails. Fixes: 9e46b8bb0539 ("drm/amdgpu: validate userq buffer virtual address and size") Signed-off-by: Prike Liang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 77d8c1e commit b993999

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ int amdgpu_userq_input_va_validate(struct amdgpu_vm *vm, u64 addr,
7171
return 0;
7272
}
7373

74+
r = -EINVAL;
7475
out_err:
7576
amdgpu_bo_unreserve(vm->root.bo);
7677
return r;
@@ -476,6 +477,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
476477
if (amdgpu_userq_input_va_validate(&fpriv->vm, args->in.queue_va, args->in.queue_size) ||
477478
amdgpu_userq_input_va_validate(&fpriv->vm, args->in.rptr_va, AMDGPU_GPU_PAGE_SIZE) ||
478479
amdgpu_userq_input_va_validate(&fpriv->vm, args->in.wptr_va, AMDGPU_GPU_PAGE_SIZE)) {
480+
r = -EINVAL;
479481
kfree(queue);
480482
goto unlock;
481483
}

0 commit comments

Comments
 (0)