diff options
Diffstat (limited to 'arch/x86/mm/gup.c')
-rw-r--r-- | arch/x86/mm/gup.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index 6340cef6798a..f97480941269 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -247,10 +247,15 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
247 | start &= PAGE_MASK; | 247 | start &= PAGE_MASK; |
248 | addr = start; | 248 | addr = start; |
249 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 249 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
250 | |||
250 | end = start + len; | 251 | end = start + len; |
251 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 252 | if (end < start) |
252 | (void __user *)start, len))) | 253 | goto slow_irqon; |
254 | |||
255 | #ifdef CONFIG_X86_64 | ||
256 | if (end >> __VIRTUAL_MASK_SHIFT) | ||
253 | goto slow_irqon; | 257 | goto slow_irqon; |
258 | #endif | ||
254 | 259 | ||
255 | /* | 260 | /* |
256 | * XXX: batch / limit 'nr', to avoid large irq off latency | 261 | * XXX: batch / limit 'nr', to avoid large irq off latency |