diff options
Diffstat (limited to 'meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch')
-rw-r--r-- | meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch new file mode 100644 index 00000000..dc8bbebf --- /dev/null +++ b/meta-xilinx-core/recipes-graphics/mali/kernel-module-mali/0016-mali_memory_secure-Kernel-5.0-onwards-access_ok-API-.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 8cf1dd43f3f25cb4afb84dfc3b0e7c02bc8f7f0c Mon Sep 17 00:00:00 2001 | ||
2 | From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
3 | Date: Mon, 24 Feb 2020 18:19:37 -0800 | ||
4 | Subject: [LINUX][rel-v2020.1][PATCH v1 1/3] mali_memory_secure: Kernel 5.0 | ||
5 | onwards 'access_ok' API does not take 'type' as input parameter | ||
6 | |||
7 | 'access_ok' no longer needs 'type' as input paramter from kernel 5.0 | ||
8 | onwards. | ||
9 | |||
10 | Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com> | ||
11 | --- | ||
12 | driver/src/devicedrv/mali/linux/mali_ukk_mem.c | 9 +++++++++ | ||
13 | 1 file changed, 9 insertions(+) | ||
14 | |||
15 | diff --git a/driver/src/devicedrv/mali/linux/mali_ukk_mem.c b/driver/src/devicedrv/mali/linux/mali_ukk_mem.c | ||
16 | index 4ec57dc..270bb6d 100644 | ||
17 | --- linux/mali_ukk_mem.c | ||
18 | +++ b/linux/mali_ukk_mem.c | ||
19 | @@ -207,8 +207,13 @@ int mem_write_safe_wrapper(struct mali_session_data *session_data, _mali_uk_mem_ | ||
20 | kargs.ctx = (uintptr_t)session_data; | ||
21 | |||
22 | /* Check if we can access the buffers */ | ||
23 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) | ||
24 | + if (!access_ok((const void __user *)kargs.dest, kargs.size) | ||
25 | + || !access_ok((const void __user *)kargs.src, kargs.size)) { | ||
26 | +#else | ||
27 | if (!access_ok(VERIFY_WRITE, kargs.dest, kargs.size) | ||
28 | || !access_ok(VERIFY_READ, kargs.src, kargs.size)) { | ||
29 | +#endif | ||
30 | return -EINVAL; | ||
31 | } | ||
32 | |||
33 | @@ -266,7 +271,11 @@ int mem_dump_mmu_page_table_wrapper(struct mali_session_data *session_data, _mal | ||
34 | goto err_exit; | ||
35 | |||
36 | user_buffer = (void __user *)(uintptr_t)kargs.buffer; | ||
37 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) | ||
38 | + if (!access_ok(user_buffer, kargs.size)) | ||
39 | +#else | ||
40 | if (!access_ok(VERIFY_WRITE, user_buffer, kargs.size)) | ||
41 | +#endif | ||
42 | goto err_exit; | ||
43 | |||
44 | /* allocate temporary buffer (kernel side) to store mmu page table info */ | ||
45 | -- | ||
46 | 2.7.4 | ||
47 | |||