]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/usercopy: Drop extra is_vmalloc_or_module() check
authorLaura Abbott <labbott@redhat.com>
Tue, 4 Apr 2017 21:09:00 +0000 (14:09 -0700)
committerKees Cook <keescook@chromium.org>
Wed, 5 Apr 2017 19:30:18 +0000 (12:30 -0700)
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 <labbott@redhat.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
mm/usercopy.c

index 1eba99baf1cf652eab70d85d592dc7e8e600944b..a9852b24715d25598a7603560ffc042ca0153a2b 100644 (file)
@@ -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;