[PATCH 1/4] drm/amdgpu: restrict userptr even more

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Chunming Zhou <david1.zhou at amd.com>, For the other three, we'd 
better to wait for our UMD guys tests.


On 2017å¹´08æ??30æ?¥ 23:00, Christian König wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Don't allow them to be GEM imported into another process.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index d028806..e32a2b5 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,
>   	struct amdgpu_fpriv *fpriv = file_priv->driver_priv;
>   	struct amdgpu_vm *vm = &fpriv->vm;
>   	struct amdgpu_bo_va *bo_va;
> +	struct mm_struct *mm;
>   	int r;
> +
> +	mm = amdgpu_ttm_tt_get_usermm(abo->tbo.ttm);
> +	if (mm && mm != current->mm)
> +		return -EPERM;
> +
>   	r = amdgpu_bo_reserve(abo, false);
>   	if (r)
>   		return r;



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux