Re: [PATCH v6 5/9] kernel: Implement selective syscall userspace redirection

From
Matthew Wilcox <willy@infradead.org>
Date
2020-09-05 11:25:29
Also in
linux-kselftest, lkml
Reply to
Gabriel Krisman Bertazi, 2020-09-04
On Fri, Sep 04, 2020 at 04:31:43PM -0400, Gabriel Krisman Bertazi wrote:
quoted hunk ↗ jump to hunk
+int set_syscall_user_dispatch(int mode, unsigned long dispatcher_start,
+			      unsigned long dispatcher_end, char __user *selector)
+{
+	switch (mode) {
+	case PR_SYS_DISPATCH_OFF:
...
+	case PR_SYS_DISPATCH_ON:
...
+	default:
+		return -EINVAL;
...
quoted hunk ↗ jump to hunk
+	case PR_SET_SYSCALL_USER_DISPATCH:
+		error = set_syscall_user_dispatch((int) arg2, arg3, arg4,
+						  (char __user *) arg5);
This makes aliases of DISPATCH_OFF and DISPATCH_ON every 4GB throughout
the 64-bit space of arg2.  I don't think that was intentional (nor
desirable).  I'd suggest just making 'mode' a long and dropping the cast.
Thread (28 messages) 28 messages, 7 authors, last reply 2020-09-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help