mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-23 07:11:26 +00:00
56 lines
2 KiB
Diff
56 lines
2 KiB
Diff
From 491af9a7e7ccddb1c3045c7f9cd2990f6d22154f Mon Sep 17 00:00:00 2001
|
|
From: Andreas Baierl <ichgeh@imkreisrum.de>
|
|
Date: Tue, 16 Oct 2018 03:19:20 -0400
|
|
Subject: [PATCH 125/146] drm/lima: Fix lima cache creation
|
|
|
|
Due to the kernel merge of the hardened usercopy patch set
|
|
we have to whitelist the memory area which is used for
|
|
copy_from_user actions. Otherwise lima fails with an abort
|
|
and segmentation fault.
|
|
|
|
This is necessary on systems with CONFIG_HARDENED_USERCOPY enabled.
|
|
It was tested on a Cubieboard 1, Allwinner A10.
|
|
|
|
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
|
|
---
|
|
drivers/gpu/drm/lima/lima_gp.c | 5 +++--
|
|
drivers/gpu/drm/lima/lima_pp.c | 5 +++--
|
|
2 files changed, 6 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/gpu/drm/lima/lima_gp.c b/drivers/gpu/drm/lima/lima_gp.c
|
|
index 706652cb1741..6c902648e5cd 100644
|
|
--- a/drivers/gpu/drm/lima/lima_gp.c
|
|
+++ b/drivers/gpu/drm/lima/lima_gp.c
|
|
@@ -245,9 +245,10 @@ int lima_gp_pipe_init(struct lima_device *dev)
|
|
struct lima_sched_pipe *pipe = dev->pipe + lima_pipe_gp;
|
|
|
|
if (!lima_gp_task_slab) {
|
|
- lima_gp_task_slab = kmem_cache_create(
|
|
+ lima_gp_task_slab = kmem_cache_create_usercopy(
|
|
"lima_gp_task", sizeof(struct lima_sched_task) + frame_size,
|
|
- 0, SLAB_HWCACHE_ALIGN, NULL);
|
|
+ 0, SLAB_HWCACHE_ALIGN, sizeof(struct lima_sched_task),
|
|
+ frame_size, NULL);
|
|
if (!lima_gp_task_slab)
|
|
return -ENOMEM;
|
|
}
|
|
diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c
|
|
index 3355895ceeba..502190d1bf3f 100644
|
|
--- a/drivers/gpu/drm/lima/lima_pp.c
|
|
+++ b/drivers/gpu/drm/lima/lima_pp.c
|
|
@@ -383,9 +383,10 @@ int lima_pp_pipe_init(struct lima_device *dev)
|
|
frame_size = sizeof(struct drm_lima_m450_pp_frame);
|
|
|
|
if (!lima_pp_task_slab) {
|
|
- lima_pp_task_slab = kmem_cache_create(
|
|
+ lima_pp_task_slab = kmem_cache_create_usercopy(
|
|
"lima_pp_task", sizeof(struct lima_sched_task) + frame_size,
|
|
- 0, SLAB_HWCACHE_ALIGN, NULL);
|
|
+ 0, SLAB_HWCACHE_ALIGN, sizeof(struct lima_sched_task),
|
|
+ frame_size, NULL);
|
|
if (!lima_pp_task_slab)
|
|
return -ENOMEM;
|
|
}
|
|
--
|
|
2.17.1
|
|
|