mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 09:36:15 +07:00
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>
This commit is contained in:
parent
0f2fc435d8
commit
4f5839c56e
@ -112,7 +112,13 @@ int amdgpu_gem_object_open(struct drm_gem_object *obj,
|
|||||||
struct amdgpu_fpriv *fpriv = file_priv->driver_priv;
|
struct amdgpu_fpriv *fpriv = file_priv->driver_priv;
|
||||||
struct amdgpu_vm *vm = &fpriv->vm;
|
struct amdgpu_vm *vm = &fpriv->vm;
|
||||||
struct amdgpu_bo_va *bo_va;
|
struct amdgpu_bo_va *bo_va;
|
||||||
|
struct mm_struct *mm;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
mm = amdgpu_ttm_tt_get_usermm(abo->tbo.ttm);
|
||||||
|
if (mm && mm != current->mm)
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
r = amdgpu_bo_reserve(abo, false);
|
r = amdgpu_bo_reserve(abo, false);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
Reference in New Issue
Block a user