aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0237-drm-amdgpu-set-bulk_moveable-to-false-when-a-per-VM-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0237-drm-amdgpu-set-bulk_moveable-to-false-when-a-per-VM-.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0237-drm-amdgpu-set-bulk_moveable-to-false-when-a-per-VM-.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0237-drm-amdgpu-set-bulk_moveable-to-false-when-a-per-VM-.patch b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0237-drm-amdgpu-set-bulk_moveable-to-false-when-a-per-VM-.patch
new file mode 100644
index 00000000..5bfc5dcf
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0237-drm-amdgpu-set-bulk_moveable-to-false-when-a-per-VM-.patch
@@ -0,0 +1,37 @@
+From d20340405f39f0139c4cd420ce993a09822d9a98 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Wed, 5 Sep 2018 17:04:44 +0200
+Subject: [PATCH 0237/2940] drm/amdgpu: set bulk_moveable to false when a per
+ VM is released
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Otherwise we might run into a use after free during bulk move.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+index 1a8a299f552e..f12c050aaae3 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+@@ -2466,8 +2466,12 @@ void amdgpu_vm_bo_rmv(struct amdgpu_device *adev,
+ struct amdgpu_bo_va *bo_va)
+ {
+ struct amdgpu_bo_va_mapping *mapping, *next;
++ struct amdgpu_bo *bo = bo_va->base.bo;
+ struct amdgpu_vm *vm = bo_va->base.vm;
+
++ if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv)
++ vm->bulk_moveable = false;
++
+ list_del(&bo_va->base.bo_list);
+
+ spin_lock(&vm->moved_lock);
+--
+2.17.1
+