lkml.org 
[lkml]   [2020]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 5/9] kernel: Implement selective syscall userspace redirection
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:
...
> + case PR_SYS_DISPATCH_ON:
...
> + default:
> + return -EINVAL;
...
> + 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.

\
 
 \ /
  Last update: 2020-09-05 13:26    [W:0.200 / U:1.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site