All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu: restrict userptr even more
@ 2017-08-29 17:07 Christian König
       [not found] ` <1504026462-1788-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2017-08-29 17:07 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

Don't allow them to be GEM imported into another process.

Signed-off-by: Christian König <christian.koenig@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;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-08-30  7:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 17:07 [PATCH 1/4] drm/amdgpu: restrict userptr even more Christian König
     [not found] ` <1504026462-1788-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-29 17:07   ` [PATCH 2/4] drm/amdgpu: add support for per VM BOs v2 Christian König
2017-08-29 17:07   ` [PATCH 3/4] drm/amdgpu: add IOCTL interface " Christian König
     [not found]     ` <1504026462-1788-3-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-29 17:20       ` Deucher, Alexander
     [not found]         ` <CY4PR12MB16532A33114CD81C3389D05EF79F0-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-08-30  6:09           ` Christian König
     [not found]             ` <c7a4040d-6458-96a2-8096-498be5d0cf5d-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-30  6:42               ` Michel Dänzer
     [not found]                 ` <f2c9784d-880b-00da-cdcd-b794dc43b1da-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-08-30  6:46                   ` Michel Dänzer
     [not found]                     ` <4c0b0f45-43c7-f831-d407-8d2ffba4c586-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-08-30  7:34                       ` Christian König
     [not found]                         ` <c6cdb302-94a8-8136-ab77-a4831c35b16d-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-30  7:39                           ` Michel Dänzer
     [not found]                             ` <83b68536-fdcc-ddeb-dbe4-c3c03c97e7da-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-08-30  7:43                               ` Christian König
     [not found]                                 ` <5bc9d4ee-95ff-5482-8a8a-03c421b71319-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-30  7:52                                   ` Michel Dänzer
2017-08-29 17:07   ` [PATCH 4/4] drm/amdgpu: bump version for support of local BOs Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.