aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/0867-drm-amdgpu-restrict-userptr-even-more.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/0867-drm-amdgpu-restrict-userptr-even-more.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/0867-drm-amdgpu-restrict-userptr-even-more.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/0867-drm-amdgpu-restrict-userptr-even-more.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/0867-drm-amdgpu-restrict-userptr-even-more.patch
new file mode 100644
index 00000000..d7b4a90e
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/0867-drm-amdgpu-restrict-userptr-even-more.patch
@@ -0,0 +1,38 @@
+From 113e58add269ef19e9994544a85bc4b34e809410 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Tue, 29 Aug 2017 16:07:31 +0200
+Subject: [PATCH 0867/4131] drm/amdgpu: restrict userptr even more
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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>
+---
+ 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 00bc506..768de03 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+@@ -155,7 +155,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
+