Skip to content

Commit

Permalink
mm/usercopy: Drop extra is_vmalloc_or_module() check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Mark Rutland <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
labbott authored and kees committed Apr 5, 2017
1 parent 96dc4f9 commit 517e1fb
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions mm/usercopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 517e1fb

Please sign in to comment.