diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-20 20:11:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-20 20:11:19 -0400 |
commit | 7d1e042314619115153a0f6f06e4552c09a50e13 (patch) | |
tree | 25d4271356edf0fe0f519393582328dc74859bbc | |
parent | e23d4159b109167126e5bcd7f3775c95de7fee47 (diff) | |
parent | aa4f0601115319a52c80f468c8f007e5aa9277cb (diff) |
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
-rw-r--r-- | mm/usercopy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c index 089328f2b920..3c8da0af9695 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c | |||
@@ -207,8 +207,11 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n, | |||
207 | * Some architectures (arm64) return true for virt_addr_valid() on | 207 | * Some architectures (arm64) return true for virt_addr_valid() on |
208 | * vmalloced addresses. Work around this by checking for vmalloc | 208 | * vmalloced addresses. Work around this by checking for vmalloc |
209 | * first. | 209 | * first. |
210 | * | ||
211 | * We also need to check for module addresses explicitly since we | ||
212 | * may copy static data from modules to userspace | ||
210 | */ | 213 | */ |
211 | if (is_vmalloc_addr(ptr)) | 214 | if (is_vmalloc_or_module_addr(ptr)) |
212 | return NULL; | 215 | return NULL; |
213 | 216 | ||
214 | if (!virt_addr_valid(ptr)) | 217 | if (!virt_addr_valid(ptr)) |