tracing/kprobe: Cast user-space address correctly
Cast user-space address correctly to pass to probe_user_read().
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index ff14eb0..2c5357d 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 */