From: Laura Abbott Date: Tue, 4 Apr 2017 21:09:00 +0000 (-0700) Subject: mm/usercopy: Drop extra is_vmalloc_or_module() check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=517e1fbeb65f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mm/usercopy: Drop extra is_vmalloc_or_module() check Previously virt_addr_valid() was insufficient to validate if virt_to_page() could be called on an address on arm64. This has since been fixed up so there is no need for the extra check. Drop it. Signed-off-by: Laura Abbott Acked-by: Mark Rutland Signed-off-by: Kees Cook --- diff --git a/mm/usercopy.c b/mm/usercopy.c index 1eba99baf1cf..a9852b24715d 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -200,17 +200,6 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n, { struct page *page; - /* - * Some architectures (arm64) return true for virt_addr_valid() on - * vmalloced addresses. Work around this by checking for vmalloc - * first. - * - * We also need to check for module addresses explicitly since we - * may copy static data from modules to userspace - */ - if (is_vmalloc_or_module_addr(ptr)) - return NULL; - if (!virt_addr_valid(ptr)) return NULL;