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

2020-09-11 Thread peterz
On Fri, Sep 04, 2020 at 04:31:43PM -0400, Gabriel Krisman Bertazi wrote: > +struct syscall_user_dispatch { > + char __user *selector; > + unsigned long dispatcher_start; > + unsigned long dispatcher_end; > +}; > +int do_syscall_user_dispatch(struct pt_regs *regs) > +{ > + struct

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

2020-09-05 Thread Matthew Wilcox
On Fri, Sep 04, 2020 at 04:31:43PM -0400, Gabriel Krisman Bertazi wrote: > +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:

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

2020-09-04 Thread Gabriel Krisman Bertazi
Introduce a mechanism to quickly disable/enable syscall handling for a specific process and redirect to userspace via SIGSYS. This is useful for processes with parts that require syscall redirection and parts that don't, but who need to perform this boundary crossing really fast, without paying