mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-11 03:51:41 +01:00
perf/x86: Check user address explicitly in copy_from_user_nmi()
Signed-off-by: Arun Sharma <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: [email protected] Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
bc6ca7b342
commit
db0dc75d64
1 file changed
+4
@@ -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) == 0)
|
||||
return len;
|
||||
|
||||
do {
|
||||
ret = __get_user_pages_fast(addr, 1, 0, &page);
|
||||
if (!ret)
|
||||
|
||||
Reference in new issue
Block a user