Commit 7d1e0423 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'usercopy-v4.8-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull usercopy hardening fix from Kees Cook:
 "Expand the arm64 vmalloc check to include skipping the module space
  too"

* tag 'usercopy-v4.8-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  mm: usercopy: Check for module addresses
parents e23d4159 aa4f0601
...@@ -207,8 +207,11 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n, ...@@ -207,8 +207,11 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n,
* Some architectures (arm64) return true for virt_addr_valid() on * Some architectures (arm64) return true for virt_addr_valid() on
* vmalloced addresses. Work around this by checking for vmalloc * vmalloced addresses. Work around this by checking for vmalloc
* first. * first.
*
* We also need to check for module addresses explicitly since we
* may copy static data from modules to userspace
*/ */
if (is_vmalloc_addr(ptr)) if (is_vmalloc_or_module_addr(ptr))
return NULL; return NULL;
if (!virt_addr_valid(ptr)) if (!virt_addr_valid(ptr))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment