Re: [PATCH 1/5] exec: move allow_write_access/fput to exec_binprm()

2013-08-04 Thread Oleg Nesterov
On 08/03, Kees Cook wrote: > > On Fri, Aug 2, 2013 at 12:27 PM, Oleg Nesterov wrote: > > @@ -1455,6 +1451,11 @@ static int exec_binprm(struct linux_binprm *bprm) > > ptrace_event(PTRACE_EVENT_EXEC, old_vpid); > > current->did_exec = 1; > > proc_exec_

Re: [PATCH 1/5] exec: move allow_write_access/fput to exec_binprm()

2013-08-03 Thread Kees Cook
On Fri, Aug 2, 2013 at 12:27 PM, Oleg Nesterov wrote: > When search_binary_handler() succeeds it does allow_write_access() > and fput(), then it clears bprm->file to ensure the caller will not > do the same. > > We can simply move this code to exec_binprm() which is called only > once. In fact we

[PATCH 1/5] exec: move allow_write_access/fput to exec_binprm()

2013-08-02 Thread Oleg Nesterov
When search_binary_handler() succeeds it does allow_write_access() and fput(), then it clears bprm->file to ensure the caller will not do the same. We can simply move this code to exec_binprm() which is called only once. In fact we could move this to free_bprm() and remove the same code in do_exec