Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-13 Thread Thomas Gleixner
On Sun, 2007-08-12 at 23:44 +0400, Oleg Nesterov wrote: > > > --- t/kernel/posix-timers.c~2_CREATE 2007-08-12 17:59:17.0 > > > +0400 > > > +++ t/kernel/posix-timers.c 2007-08-12 18:11:33.0 +0400 > > > @@ -547,13 +547,12 @@ sys_timer_create(const clockid_t which_c > > >

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-13 Thread Thomas Gleixner
On Sun, 2007-08-12 at 23:44 +0400, Oleg Nesterov wrote: --- t/kernel/posix-timers.c~2_CREATE 2007-08-12 17:59:17.0 +0400 +++ t/kernel/posix-timers.c 2007-08-12 18:11:33.0 +0400 @@ -547,13 +547,12 @@ sys_timer_create(const clockid_t which_c

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Oleg Nesterov
ore(>sighand->siglock, > > > flags); > > i'll resend this patch tomorrow. We can't do > spin_unlock_irqrestore(>...) > if we set process = NULL above. Another attempt, no cleanups, just a minimal fix for now. [PATCH 2/4] posix-timers: fix creation race sys_time

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Oleg Nesterov
On 08/12, Thomas Gleixner wrote: > > On Sun, 2007-08-12 at 21:05 +0400, Oleg Nesterov wrote: > > sys_timer_create() sets ->it_process and unlocks ->siglock, then checks > > tmr->it_sigev_notify to define if get_task_struct() is needed. > > > > We already passed ->it_id to the caller, another

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Thomas Gleixner
On Sun, 2007-08-12 at 21:05 +0400, Oleg Nesterov wrote: > sys_timer_create() sets ->it_process and unlocks ->siglock, then checks > tmr->it_sigev_notify to define if get_task_struct() is needed. > > We already passed ->it_id to the caller, another thread can delete this > timer and free its

[PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Oleg Nesterov
sys_timer_create() sets ->it_process and unlocks ->siglock, then checks tmr->it_sigev_notify to define if get_task_struct() is needed. We already passed ->it_id to the caller, another thread can delete this timer and free its memory in between. As a minimal fix, move this code under ->siglock,

[PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Oleg Nesterov
sys_timer_create() sets -it_process and unlocks -siglock, then checks tmr-it_sigev_notify to define if get_task_struct() is needed. We already passed -it_id to the caller, another thread can delete this timer and free its memory in between. As a minimal fix, move this code under -siglock,

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Thomas Gleixner
On Sun, 2007-08-12 at 21:05 +0400, Oleg Nesterov wrote: sys_timer_create() sets -it_process and unlocks -siglock, then checks tmr-it_sigev_notify to define if get_task_struct() is needed. We already passed -it_id to the caller, another thread can delete this timer and free its memory in

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Oleg Nesterov
On 08/12, Thomas Gleixner wrote: On Sun, 2007-08-12 at 21:05 +0400, Oleg Nesterov wrote: sys_timer_create() sets -it_process and unlocks -siglock, then checks tmr-it_sigev_notify to define if get_task_struct() is needed. We already passed -it_id to the caller, another thread can delete

Re: [PATCH 2/4] posix-timers: fix creation race

2007-08-12 Thread Oleg Nesterov
tomorrow. We can't do spin_unlock_irqrestore(process-...) if we set process = NULL above. Another attempt, no cleanups, just a minimal fix for now. [PATCH 2/4] posix-timers: fix creation race sys_timer_create() sets -it_process and unlocks -siglock, then checks tmr-it_sigev_notify to define