Re: [PATCH 2/4] check_unsafe_exec: kill the dead -EAGAIN and clear_in_exec logic

2013-11-23 Thread Oleg Nesterov
On 11/22, KOSAKI Motohiro wrote: > > >> I have found no problem in this patch. However, I have a very basic > >> question. > >> Why do we need to keep fs->in_exec? > > > > To ensure that a sub-thread can't create a new process with the same > > ->fs while we are doing exec without LSM_UNSAFE_SHARE

Re: [PATCH 2/4] check_unsafe_exec: kill the dead -EAGAIN and clear_in_exec logic

2013-11-22 Thread KOSAKI Motohiro
>> I have found no problem in this patch. However, I have a very basic question. >> Why do we need to keep fs->in_exec? > > To ensure that a sub-thread can't create a new process with the same > ->fs while we are doing exec without LSM_UNSAFE_SHARE, I guess. This > is only for security/ code. But

Re: [PATCH 2/4] check_unsafe_exec: kill the dead -EAGAIN and clear_in_exec logic

2013-11-22 Thread Oleg Nesterov
On 11/22, KOSAKI Motohiro wrote: > > (11/22/2013 12:54 PM), Oleg Nesterov wrote: > > fs_struct->in_exec == T means that this ->fs is used by a single > > process (thread group), and one of the treads does do_execve(). > > > > To avoid the mt-exec races this code has the following complications: > >

Re: [PATCH 2/4] check_unsafe_exec: kill the dead -EAGAIN and clear_in_exec logic

2013-11-22 Thread KOSAKI Motohiro
(11/22/2013 12:54 PM), Oleg Nesterov wrote: > fs_struct->in_exec == T means that this ->fs is used by a single > process (thread group), and one of the treads does do_execve(). > > To avoid the mt-exec races this code has the following complications: > > 1. check_unsafe_exec() returns -EBUS

[PATCH 2/4] check_unsafe_exec: kill the dead -EAGAIN and clear_in_exec logic

2013-11-22 Thread Oleg Nesterov
fs_struct->in_exec == T means that this ->fs is used by a single process (thread group), and one of the treads does do_execve(). To avoid the mt-exec races this code has the following complications: 1. check_unsafe_exec() returns -EBUSY if ->in_exec was already set by another t