aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2017-04-04 17:09:00 -0400
committerKees Cook <keescook@chromium.org>2017-04-05 15:30:18 -0400
commit517e1fbeb65f5eade8d14f46ac365db6c75aea9b (patch)
treee11991a0fd19229b26d945d72415938609238b99
parent96dc4f9fb64690fc34410415fd1fc609cf803f61 (diff)
mm/usercopy: Drop extra is_vmalloc_or_module() check
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>
-rw-r--r--mm/usercopy.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 1eba99baf1cf..a9852b24715d 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -200,17 +200,6 @@ static inline const char *check_heap_object(const void *ptr, unsigned long n,
200{ 200{
201 struct page *page; 201 struct page *page;
202 202
203 /*
204 * Some architectures (arm64) return true for virt_addr_valid() on
205 * vmalloced addresses. Work around this by checking for vmalloc
206 * first.
207 *
208 * We also need to check for module addresses explicitly since we
209 * may copy static data from modules to userspace
210 */
211 if (is_vmalloc_or_module_addr(ptr))
212 return NULL;
213
214 if (!virt_addr_valid(ptr)) 203 if (!virt_addr_valid(ptr))
215 return NULL; 204 return NULL;
216 205