Re: [PATCH 3/7] exec: Move initialization of bprm->filename into alloc_bprm

2020-07-14 Thread Christoph Hellwig
On Tue, Jul 14, 2020 at 08:29:36AM -0500, Eric W. Biederman wrote: > > -static struct linux_binprm *alloc_bprm(void) > +static struct linux_binprm *alloc_bprm(int fd, struct filename *filename) > { > struct linux_binprm *bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); > + int retval = -ENOM

Re: [PATCH 3/7] exec: Move initialization of bprm->filename into alloc_bprm

2020-07-14 Thread Kees Cook
On Tue, Jul 14, 2020 at 08:29:36AM -0500, Eric W. Biederman wrote: > > Currently it is necessary for the usermode helper code and the code > that launches init to use set_fs so that pages coming from the kernel > look like they are coming from userspace. > > To allow that usage of set_fs to be re

[PATCH 3/7] exec: Move initialization of bprm->filename into alloc_bprm

2020-07-14 Thread Eric W. Biederman
Currently it is necessary for the usermode helper code and the code that launches init to use set_fs so that pages coming from the kernel look like they are coming from userspace. To allow that usage of set_fs to be removed cleanly the argument copying from userspace needs to happen earlier. Mo