]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tracing/user_events: Use WRITE instead of READ for io vector import
authorBeau Belgrave <beaub@linux.microsoft.com>
Thu, 28 Jul 2022 23:33:05 +0000 (16:33 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 29 Sep 2022 14:17:36 +0000 (10:17 -0400)
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>
kernel/trace/trace_events_user.c

index 075d694d20e3d7daf408c8cb7e967b5398ddb9e4..15edbf6b1e2ed612aeafd50ded863acc7bca1127 100644 (file)
@@ -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);