Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-03 Thread Oleg Nesterov
On 08/03, Srikar Dronamraju wrote: > > * Oleg Nesterov [2012-08-02 19:53:12]: > > > On 08/02, Srikar Dronamraju wrote: > > > > > > This is case where the uprobe_mmap() and uprobe_unregister() raced, and > > > by the time install_breakpoint() was called by uprobe_mmap(), there were > > > no consume

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-03 Thread Oleg Nesterov
On 08/03, Srikar Dronamraju wrote: > > > But mmap_region() is worse, much worse. It simply can _not_ fail > > after uprobe_mmap (of course, I am not saying this is unfixable) > > without the crash. And note that the crash is "delayed". And btw, > > like dup_mmap(), mmap_region() doesn't return the

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-03 Thread Srikar Dronamraju
> OK, lets start with dup_mmap: > > // retval == 0 > > if (file && uprobe_mmap(tmp)) > goto out; > > out: > up_write(&mm->mmap_sem); > flush_tlb_mm(oldmm); > up_write(&oldmm->mmap_sem); >

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Srikar Dronamraju
* Oleg Nesterov [2012-08-02 19:53:12]: > On 08/02, Srikar Dronamraju wrote: > > > > * Oleg Nesterov [2012-08-02 16:17:57]: > > > > > Forgot to mention... > > > > > > On 08/02, Srikar Dronamraju wrote: > > > > > > > > While at it, add a missing put_uprobe() in the path where uprobe_mmap() > > > >

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Oleg Nesterov
On 08/02, Srikar Dronamraju wrote: > > * Oleg Nesterov [2012-08-02 16:17:57]: > > > Forgot to mention... > > > > On 08/02, Srikar Dronamraju wrote: > > > > > > While at it, add a missing put_uprobe() in the path where uprobe_mmap() > > > races with uprobe_unregister(). > > > ... > > > @@ -1051,8 +

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Oleg Nesterov
On 08/02, Srikar Dronamraju wrote: > > How about having your fix + my patch to fix the uprobe_mmap()? (I guess you mean -ENOTSUPP part) Perhaps... But, as I said, I think that until we fix the callers uprobe_mmap() should ignore all errors and proceed. Except, perhaps, it makes sense to check fa

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Srikar Dronamraju
* Oleg Nesterov [2012-08-02 16:17:57]: > Forgot to mention... > > On 08/02, Srikar Dronamraju wrote: > > > > While at it, add a missing put_uprobe() in the path where uprobe_mmap() > > races with uprobe_unregister(). > > ... > > @@ -1051,8 +1051,10 @@ int uprobe_mmap(struct vm_area_struct *vma)

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Srikar Dronamraju
> > uprobe_mmap()->install_breakpoint() can fail if the probed insn is not > > supported > > But there are other reasons why it can fail, > > > However failing mmap_region()/do_fork() because of a probe on an > > unsupported instruction is wrong. > > Srikar, I strongly, absolutely disagree. Plea

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Oleg Nesterov
Forgot to mention... On 08/02, Srikar Dronamraju wrote: > > While at it, add a missing put_uprobe() in the path where uprobe_mmap() > races with uprobe_unregister(). > ... > @@ -1051,8 +1051,10 @@ int uprobe_mmap(struct vm_area_struct *vma) > if (ret == -EEXIST) { >

Re: [PATCH] uprobes: Ignore unsupported instructions in uprobe_mmap

2012-08-02 Thread Oleg Nesterov
On 08/02, Srikar Dronamraju wrote: > > uprobe_mmap()->install_breakpoint() can fail if the probed insn is not > supported But there are other reasons why it can fail, > However failing mmap_region()/do_fork() because of a probe on an > unsupported instruction is wrong. Srikar, I strongly, absolu