Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-23 Thread Oleg Nesterov
On 07/22, Oleg Nesterov wrote: > > On 07/22, Masami Hiramatsu wrote: > > > > (2013/07/19 22:33), Oleg Nesterov wrote: > > > >> OK, let me confirm that, would you mean we still need 2/4 - 4/4? > > > > > > Yes, yes. > > > > And those are depends on 1/4... > > Not at all or I missed something (quite p

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-22 Thread Oleg Nesterov
On 07/22, Masami Hiramatsu wrote: > > (2013/07/19 22:33), Oleg Nesterov wrote: > > My only point, imho this is more complex than necessary. > > I see, so I'd like to see the fix. However, I'm not sure > we have enough time to fix that cleanly. I promise, tomorrow I'll re-send the RFC patches, so i

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-22 Thread Masami Hiramatsu
(2013/07/19 22:33), Oleg Nesterov wrote: > On 07/19, Masami Hiramatsu wrote: >> >> (2013/07/18 23:51), Oleg Nesterov wrote: >>> It removes trace_array_get/put from tracing_open_generic_file() and >>> tracing_release_generic_file(). This assumes that "call->flags++" is >>> enough, but it is not. >>

Re: Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-19 Thread Oleg Nesterov
On 07/19, Masami Hiramatsu wrote: > > (2013/07/18 23:51), Oleg Nesterov wrote: > > It removes trace_array_get/put from tracing_open_generic_file() and > > tracing_release_generic_file(). This assumes that "call->flags++" is > > enough, but it is not. > > No, it replaces trace_array_get/put with ftr

Re: Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-18 Thread Masami Hiramatsu
(2013/07/18 23:51), Oleg Nesterov wrote: > On 07/18, Masami Hiramatsu wrote: >> >> (2013/07/17 23:51), Oleg Nesterov wrote: >>> Well, perhaps you are right... But this TRACE_EVENT_FL_REF_MASK code >>> is new too, it is not that we only need a small fixlets to finish it. >> >> Would you mean that TR

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-18 Thread Oleg Nesterov
On 07/18, Masami Hiramatsu wrote: > > (2013/07/17 23:51), Oleg Nesterov wrote: > > Well, perhaps you are right... But this TRACE_EVENT_FL_REF_MASK code > > is new too, it is not that we only need a small fixlets to finish it. > > Would you mean that TRACE_EVENT_FL_REF_MASK may also have some proble

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-17 Thread Masami Hiramatsu
(2013/07/17 23:51), Oleg Nesterov wrote: > On 07/17, Masami Hiramatsu wrote: >> >> (2013/07/16 3:16), Oleg Nesterov wrote: >>> On 07/09, Masami Hiramatsu wrote: To avoid this, when opening events/*/*/enable, we have to ensure the dentry of the file is not unlinked yet, under event_mu

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-17 Thread Oleg Nesterov
On 07/17, Masami Hiramatsu wrote: > > (2013/07/16 3:16), Oleg Nesterov wrote: > > On 07/09, Masami Hiramatsu wrote: > >> > >> To avoid this, when opening events/*/*/enable, we have to ensure > >> the dentry of the file is not unlinked yet, under event_mutex > >> is locked. > > > > Probably this can

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-16 Thread Masami Hiramatsu
(2013/07/16 3:16), Oleg Nesterov wrote: > On 07/09, Masami Hiramatsu wrote: >> >> To avoid this, when opening events/*/*/enable, we have to ensure >> the dentry of the file is not unlinked yet, under event_mutex >> is locked. > > Probably this can work, but I am starting to think that this ref > c

Re: [RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-15 Thread Oleg Nesterov
On 07/09, Masami Hiramatsu wrote: > > To avoid this, when opening events/*/*/enable, we have to ensure > the dentry of the file is not unlinked yet, under event_mutex > is locked. Probably this can work, but I am starting to think that this ref count becomes too complex Could you please l

[RFC PATCH V2] tracing: Check f_dentry before accessing event_file/call in inode->i_private

2013-07-09 Thread Masami Hiramatsu
Currently ftrace_open_generic_file gets an event_file from inode->i_private, and then locks event_mutex and gets refcount. However, this can cause a race as below scenario; CPU0 CPU1 open(kprobe_events) trace_remove_event_call()open(enable) lock event_mutex