Re: [PATCH v4 2/3] fs/binfmts: Better handling of binfmt loops

2013-08-16 Thread Oleg Nesterov
On 08/15, Zach L wrote: > > On 08/14/2013 10:50 AM, Oleg Nesterov wrote: > > On 08/14, Zach Levis wrote: > >> > > Honestly, I dislike this version even more, sorry. The patch becomes > > much more complex, and and it is still not clear to me why do we want > > these complications. > > > It's a larg

Re: [PATCH v4 2/3] fs/binfmts: Better handling of binfmt loops

2013-08-15 Thread Zach L
On 08/14/2013 10:50 AM, Oleg Nesterov wrote: > On 08/14, Zach Levis wrote: >> >> Example: a qemu is configured to run 64-bit ELFs on an otherwise 32-bit >> system. The system's owner switches to running with 64-bit executables, >> but forgets to disable the binfmt_misc option that redirects 64bit E

Re: [PATCH v4 2/3] fs/binfmts: Better handling of binfmt loops

2013-08-14 Thread Oleg Nesterov
On 08/14, Zach Levis wrote: > > +static void bprm_close_file(struct linux_binprm *bprm) > +{ > + if (bprm->mm) { > + acct_arg_size(bprm, 0); > + mmput(bprm->mm); > + } > + > + if (bprm->file) { > + allow_write_access(bprm->file); > + fput(

Re: [PATCH v4 2/3] fs/binfmts: Better handling of binfmt loops

2013-08-14 Thread Oleg Nesterov
On 08/14, Zach Levis wrote: > > Example: a qemu is configured to run 64-bit ELFs on an otherwise 32-bit > system. The system's owner switches to running with 64-bit executables, > but forgets to disable the binfmt_misc option that redirects 64bit ELFs > to qemu. Since the qemu executable is a 64-bi