[for-next][PATCH 11/16] tracing/kprobe: Cast user-space address correctly
From: Steven Rostedt
Date: Sun May 26 2019 - 15:22:35 EST
From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cast user-space address correctly to pass to probe_user_read().
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
---
kernel/trace/trace_kprobe.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index ff14eb011c1c..2c5357dddb92 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -955,7 +955,9 @@ probe_mem_read(void *dest, void *src, size_t size)
static nokprobe_inline int
probe_mem_read_user(void *dest, void *src, size_t size)
{
- return probe_user_read(dest, src, size);
+ const void __user *uaddr = (__force const void __user *)src;
+
+ return probe_user_read(dest, uaddr, size);
}
/* Note that we don't verify it, since the code does not come from user space */
--
2.20.1