Messages in this thread | | | Date | Fri, 17 Oct 2014 23:34:40 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH RFC] sched: Revert delayed_put_task_struct() and fix use after free |
| |
On 10/16, Kirill Tkhai wrote: > > Cool! Elegant fix. We set PF_EXITING in exit_signals(), which is earlier > than release_task() is called.
OK, thanks, I am sending the patch...
> Shouldn't we use smp_rmb/smp_wmb here?
No, we do not. call_rcu(delayed_put_pid) itself implies the barrier on all CPUs. IOW, by the time RCU actually calls delayed_put_pid() every CPU must see all memory changes which were done before call_rcu() was called. And otoh, all rcu-read-lock critical sections which could miss PF_EXITING should be already finished.
Oleg.
| |