Re: [PATCH v4 3.0-rc2-tip 4/22] 4: Uprobes: register/unregister probes.

Srikar Dronamraju
2011-06-09T05:50:39Z

> > +
> > + mm = vma->vm_mm;
> > + if (!valid_vma(vma)) {
> > + mmput(mm);
> > + continue;
> > + }
> > +
> > + vaddr = vma->vm_start + offset;
> > + vaddr -= vma->vm_pgoff << PAGE_SHIFT;
> > + if (vaddr < vma->vm_start || vaddr > vma->vm_end) {
>
> This check looks like it is off by one? vma->vm_end is already one byte
> past the last valid address in the vma, so we should compare using ">="
> here I think.

Right, we are off-by one.
Will correct in the next patchset.
Will also correct the other places where we check for vm_end.

> > +
> > + if (!del_consumer(uprobe, consumer)) {
> > + pr_debug("No uprobe found with consumer %p\n",
> > + consumer);
> > + return;
> > + }
>
> When del_consumer() fails dont we still need to do a put_uprobe(uprobe)
> to drop the extra access ref?
>

Yes, we need to check and drop the reference.
Will correct in the next patchset.

> > +
> > + INIT_LIST_HEAD(&tmp_list);
> > +
> > + mapping = inode->i_mapping;

--
Thanks and Regards
Srikar