Re: [PATCH 3/3] uprobes: document uprobe_register() vsuprobe_mmap() race
From: Peter Zijlstra
Date: Mon Jun 04 2012 - 11:01:02 EST
On Mon, 2012-06-04 at 16:53 +0200, Oleg Nesterov wrote:
I didn't check if its my error or not, however:
> @@ -850,6 +869,10 @@ static int register_for_each_vma(struct uprobe *uprobe, bool is_register)
>
> if (is_register) {
> err = install_breakpoint(uprobe, mm, vma, info->vaddr);
> + /*
> + * We can race against uprobe_register(), see the
that should be uprobe_mmap(), since this is the register path ;-)
> + * comment near uprobe_hash().
> + */
> if (err == -EEXIST)
> err = 0;
> } else {
> @@ -1058,8 +1081,10 @@ int uprobe_mmap(struct vm_area_struct *vma)
> }
>
> ret = install_breakpoint(uprobe, vma->vm_mm, vma, vaddr);
> -
> - /* Ignore double add: */
> + /*
> + * We can race against uprobe_register(), see the
> + * comment near uprobe_hash().
> + */
> if (ret == -EEXIST) {
> ret = 0;
>
--
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/