mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
Merge "ANDROID: lkdtm/usercopy: Use __va_function to find proper vm_mmap address"
This commit is contained in:
commit
5ccc883e1d
2 changed files with 9 additions and 1 deletions
|
|
@ -314,7 +314,7 @@ void lkdtm_USERCOPY_KERNEL(void)
|
|||
|
||||
pr_info("attempting bad copy_to_user from kernel text: %px\n",
|
||||
vm_mmap);
|
||||
if (copy_to_user((void __user *)user_addr, vm_mmap,
|
||||
if (copy_to_user((void __user *)user_addr, __va_function(vm_mmap),
|
||||
unconst + PAGE_SIZE)) {
|
||||
pr_warn("copy_to_user failed, but lacked Oops\n");
|
||||
goto free_user;
|
||||
|
|
|
|||
|
|
@ -116,6 +116,14 @@ extern int mmap_rnd_compat_bits __read_mostly;
|
|||
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
|
||||
#endif
|
||||
|
||||
#ifndef __va_function
|
||||
#define __va_function(x) (x)
|
||||
#endif
|
||||
|
||||
#ifndef __pa_function
|
||||
#define __pa_function(x) __pa_symbol(x)
|
||||
#endif
|
||||
|
||||
#ifndef page_to_virt
|
||||
#define page_to_virt(x) __va(PFN_PHYS(page_to_pfn(x)))
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue