Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Beau Belgrave and committed by
Steven Rostedt (Google)
95f18760 9cbf1234

+2 -1
+2 -1
kernel/trace/trace_events_user.c
··· 1245 1245 if (unlikely(*ppos != 0)) 1246 1246 return -EFAULT; 1247 1247 1248 - if (unlikely(import_single_range(READ, (char *)ubuf, count, &iov, &i))) 1248 + if (unlikely(import_single_range(WRITE, (char __user *)ubuf, 1249 + count, &iov, &i))) 1249 1250 return -EFAULT; 1250 1251 1251 1252 return user_events_write_core(file, &i);