Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ccc883e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ANDROID: lkdtm/usercopy: Use __va_function to find proper vm_mmap address"

parents c9e3e8d2 062642e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+8 −0
Original line number Diff line number Diff line
@@ -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