Commit f3f58935 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Steven Rostedt (VMware)

tracing/uprobes: Fix to return -EFAULT if copy_from_user failed

Fix probe_mem_read() to return -EFAULT if copy_from_user()
failed. The copy_from_user() returns remaining bytes
when it failed, but probe_mem_read() caller expects it
returns error code like as probe_kernel_read().

Link: http://lkml.kernel.org/r/153547306719.26502.8353484532699160223.stgit@devboxReported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent a1303af5
...@@ -105,7 +105,7 @@ probe_mem_read(void *dest, void *src, size_t size) ...@@ -105,7 +105,7 @@ probe_mem_read(void *dest, void *src, size_t size)
{ {
void __user *vaddr = (void __force __user *)src; void __user *vaddr = (void __force __user *)src;
return copy_from_user(dest, vaddr, size); return copy_from_user(dest, vaddr, size) ? -EFAULT : 0;
} }
/* /*
* Fetch a null-terminated string. Caller MUST set *(u32 *)dest with max * Fetch a null-terminated string. Caller MUST set *(u32 *)dest with max
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment