aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lib/usercopy.c
diff options
context:
space:
mode:
authorIngo Molnar <[email protected]>2012-07-11 07:41:37 +0000
committerIngo Molnar <[email protected]>2012-07-11 07:41:37 +0000
commit92254d31444aad272155f7963e65910c402703dd (patch)
tree8e454ebe60cbac9a71b1771d4e471cfe54826963 /arch/x86/lib/usercopy.c
parentMerge tag 'amd-thresholding-fixes-for-3.6' of git://git.kernel.org/pub/scm/li... (diff)
parentLinux 3.5-rc6 (diff)
downloadkernel-92254d31444aad272155f7963e65910c402703dd.tar.gz
kernel-92254d31444aad272155f7963e65910c402703dd.zip
Merge tag 'v3.5-rc6' into x86/mce
Merge Linux 3.5-rc6 before merging more code. Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'arch/x86/lib/usercopy.c')
-rw-r--r--arch/x86/lib/usercopy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/lib/usercopy.c b/arch/x86/lib/usercopy.c
index f61ee67ec00f..4f74d94c8d97 100644
--- a/arch/x86/lib/usercopy.c
+++ b/arch/x86/lib/usercopy.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <asm/word-at-a-time.h>
+#include <linux/sched.h>
/*
* best effort, GUP based copy_from_user() that is NMI-safe
@@ -21,6 +22,9 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
void *map;
int ret;
+ if (__range_not_ok(from, n, TASK_SIZE))
+ return len;
+
do {
ret = __get_user_pages_fast(addr, 1, 0, &page);
if (!ret)