diff options
-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 007bb06c750..73e6ce1597b 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c @@ -231,10 +231,15 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, start &= PAGE_MASK; addr = start; len = (unsigned long) nr_pages << PAGE_SHIFT; + end = start + len; - if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, - start, len))) + if (end < start) + goto slow_irqon; + +#ifdef CONFIG_X86_64 + if (end >> 47) goto slow_irqon; +#endif /* * XXX: batch / limit 'nr', to avoid large irq off latency |