aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-08-29 10:07:31 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-31 13:46:17 -0400
commit4f5839c56ec38e2f8fcc59ca0e01defa8702987b (patch)
tree054e735911ca2d3ef89034df9052180938312fcb /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parent0f2fc435d837213202bec3b8e26fbb67a4d6df24 (diff)
drm/amdgpu: restrict userptr even more
Don't allow them to be GEM imported into another process. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index d02880640ee7..e32a2b55b54f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -112,7 +112,13 @@ int amdgpu_gem_object_open(struct drm_gem_object *obj,
112 struct amdgpu_fpriv *fpriv = file_priv->driver_priv; 112 struct amdgpu_fpriv *fpriv = file_priv->driver_priv;
113 struct amdgpu_vm *vm = &fpriv->vm; 113 struct amdgpu_vm *vm = &fpriv->vm;
114 struct amdgpu_bo_va *bo_va; 114 struct amdgpu_bo_va *bo_va;
115 struct mm_struct *mm;
115 int r; 116 int r;
117
118 mm = amdgpu_ttm_tt_get_usermm(abo->tbo.ttm);
119 if (mm && mm != current->mm)
120 return -EPERM;
121
116 r = amdgpu_bo_reserve(abo, false); 122 r = amdgpu_bo_reserve(abo, false);
117 if (r) 123 if (r)
118 return r; 124 return r;