aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/gup.c6
-rw-r--r--mm/mincore.c4
2 files changed, 4 insertions, 6 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 8cb68a50dbdf..6f591ccb8eca 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1813,8 +1813,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
1813 len = (unsigned long) nr_pages << PAGE_SHIFT; 1813 len = (unsigned long) nr_pages << PAGE_SHIFT;
1814 end = start + len; 1814 end = start + len;
1815 1815
1816 if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, 1816 if (unlikely(!access_ok((void __user *)start, len)))
1817 (void __user *)start, len)))
1818 return 0; 1817 return 0;
1819 1818
1820 /* 1819 /*
@@ -1868,8 +1867,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
1868 if (nr_pages <= 0) 1867 if (nr_pages <= 0)
1869 return 0; 1868 return 0;
1870 1869
1871 if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, 1870 if (unlikely(!access_ok((void __user *)start, len)))
1872 (void __user *)start, len)))
1873 return -EFAULT; 1871 return -EFAULT;
1874 1872
1875 if (gup_fast_permitted(start, nr_pages, write)) { 1873 if (gup_fast_permitted(start, nr_pages, write)) {
diff --git a/mm/mincore.c b/mm/mincore.c
index 4985965aa20a..218099b5ed31 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -233,14 +233,14 @@ SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
233 return -EINVAL; 233 return -EINVAL;
234 234
235 /* ..and we need to be passed a valid user-space range */ 235 /* ..and we need to be passed a valid user-space range */
236 if (!access_ok(VERIFY_READ, (void __user *) start, len)) 236 if (!access_ok((void __user *) start, len))
237 return -ENOMEM; 237 return -ENOMEM;
238 238
239 /* This also avoids any overflows on PAGE_ALIGN */ 239 /* This also avoids any overflows on PAGE_ALIGN */
240 pages = len >> PAGE_SHIFT; 240 pages = len >> PAGE_SHIFT;
241 pages += (offset_in_page(len)) != 0; 241 pages += (offset_in_page(len)) != 0;
242 242
243 if (!access_ok(VERIFY_WRITE, vec, pages)) 243 if (!access_ok(vec, pages))
244 return -EFAULT; 244 return -EFAULT;
245 245
246 tmp = (void *) __get_free_page(GFP_USER); 246 tmp = (void *) __get_free_page(GFP_USER);