summaryrefslogtreecommitdiff
path: root/amdgpu
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2015-11-30 14:08:07 +0800
committerMarek Olšák <marek.olsak@amd.com>2016-01-20 02:14:46 +0100
commitf06c9928198d9348fb31325a2a480afbc29c04b8 (patch)
tree28b520fc1c19656194714debce8535caf179f85e /amdgpu
parent50386e09dbdc6fd70d02efd1371d9ad061c8d447 (diff)
downloadlibdrm-f06c9928198d9348fb31325a2a480afbc29c04b8.tar.gz
libdrm-f06c9928198d9348fb31325a2a480afbc29c04b8.tar.bz2
libdrm-f06c9928198d9348fb31325a2a480afbc29c04b8.zip
amdgpu: validate user memory for userptr
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu_bo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index 2ae1c188..d30fd1e7 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -539,7 +539,8 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
struct drm_amdgpu_gem_userptr args;
args.addr = (uintptr_t)cpu;
- args.flags = AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_REGISTER;
+ args.flags = AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_REGISTER |
+ AMDGPU_GEM_USERPTR_VALIDATE;
args.size = size;
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_USERPTR,
&args, sizeof(args));