summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events_user.c
diff options
context:
space:
mode:
authorBeau Belgrave <beaub@linux.microsoft.com>2022-07-29 01:33:05 +0200
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-09-29 16:17:36 +0200
commit95f187603dbff69bef19b2ab3bb54d2c060f556d (patch)
tree4bd81ecc025e76f08dfcf62f2b2e8bf05da554bd /kernel/trace/trace_events_user.c
parenttracing/user_events: Use NULL for strstr checks (diff)
downloadlinux-95f187603dbff69bef19b2ab3bb54d2c060f556d.tar.xz
linux-95f187603dbff69bef19b2ab3bb54d2c060f556d.zip
tracing/user_events: Use WRITE instead of READ for io vector import
import_single_range expects the direction/rw to be where it came from, not the protection/limit. Since the import is in a write path use WRITE. Link: https://lkml.kernel.org/r/20220728233309.1896-3-beaub@linux.microsoft.com Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events_user.c')
-rw-r--r--kernel/trace/trace_events_user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
index 075d694d20e3..15edbf6b1e2e 100644
--- a/kernel/trace/trace_events_user.c
+++ b/kernel/trace/trace_events_user.c
@@ -1245,7 +1245,8 @@ static ssize_t user_events_write(struct file *file, const char __user *ubuf,
if (unlikely(*ppos != 0))
return -EFAULT;
- if (unlikely(import_single_range(READ, (char *)ubuf, count, &iov, &i)))
+ if (unlikely(import_single_range(WRITE, (char __user *)ubuf,
+ count, &iov, &i)))
return -EFAULT;
return user_events_write_core(file, &i);