Re: [PATCH 3/4] exec: simplify the compat syscall handling

2021-03-26 Thread Eric W. Biederman
Christoph Hellwig writes: > diff --git a/fs/exec.c b/fs/exec.c > index 06e07278b456fa..b34c1eb9e7ad8e 100644 > --- a/fs/exec.c > +++ b/fs/exec.c > @@ -391,47 +391,34 @@ static int bprm_mm_init(struct linux_binprm *bprm) > return err; > } > > -struct user_arg_ptr { > -#ifdef

RE: [PATCH 3/4] exec: simplify the compat syscall handling

2021-03-26 Thread David Laight
From: Al Viro > Sent: 26 March 2021 16:12 > > On Fri, Mar 26, 2021 at 03:38:30PM +0100, Christoph Hellwig wrote: > > > +static const char __user * > > +get_user_arg_ptr(const char __user *const __user *argv, int nr) > > { > > + if (in_compat_syscall()) { > > + const compat_uptr_t

Re: [PATCH 3/4] exec: simplify the compat syscall handling

2021-03-26 Thread Al Viro
On Fri, Mar 26, 2021 at 03:38:30PM +0100, Christoph Hellwig wrote: > -static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr) > +static const char __user * > +get_user_arg_ptr(const char __user *const __user *argv, int nr) > { > - const char __user *native; > - > -#ifdef

Re: [PATCH 3/4] exec: simplify the compat syscall handling

2021-03-26 Thread Arnd Bergmann
On Fri, Mar 26, 2021 at 3:38 PM Christoph Hellwig wrote: > > The only differenence betweeen the compat exec* syscalls and their > native versions is the compat_ptr sign extension, and the fact that > the pointer arithmetics for the two dimensional arrays needs to use > the compat pointer size.