diff options
Diffstat (limited to 'arch/x86/lib/usercopy.c')
-rw-r--r-- | arch/x86/lib/usercopy.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/lib/usercopy.c b/arch/x86/lib/usercopy.c index c8c6ad0d58b8..3f435d7fca5e 100644 --- a/arch/x86/lib/usercopy.c +++ b/arch/x86/lib/usercopy.c | |||
@@ -7,6 +7,8 @@ | |||
7 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
8 | #include <linux/export.h> | 8 | #include <linux/export.h> |
9 | 9 | ||
10 | #include <asm/tlbflush.h> | ||
11 | |||
10 | /* | 12 | /* |
11 | * We rely on the nested NMI work to allow atomic faults from the NMI path; the | 13 | * We rely on the nested NMI work to allow atomic faults from the NMI path; the |
12 | * nested NMI paths are careful to preserve CR2. | 14 | * nested NMI paths are careful to preserve CR2. |
@@ -19,6 +21,9 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n) | |||
19 | if (__range_not_ok(from, n, TASK_SIZE)) | 21 | if (__range_not_ok(from, n, TASK_SIZE)) |
20 | return n; | 22 | return n; |
21 | 23 | ||
24 | if (!nmi_uaccess_okay()) | ||
25 | return n; | ||
26 | |||
22 | /* | 27 | /* |
23 | * Even though this function is typically called from NMI/IRQ context | 28 | * Even though this function is typically called from NMI/IRQ context |
24 | * disable pagefaults so that its behaviour is consistent even when | 29 | * disable pagefaults so that its behaviour is consistent even when |