Skip to content

Commit

Permalink
Merge tag 'usercopy-v4.8-rc8' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
Linus Torvalds committed Sep 21, 2016
2 parents e23d415 + aa4f060 commit 7d1e042
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm/usercopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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_addr(ptr))
if (is_vmalloc_or_module_addr(ptr))
return NULL;

if (!virt_addr_valid(ptr))
Expand Down

0 comments on commit 7d1e042

Please sign in to comment.