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

From: Srikar Dronamraju
Date: Thu Jun 09 2011 - 01:50:43 EST


> > +
> > + 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/