Re: [PATCH 6/7] uprobes: Do not allocate current->utask unnecessary

From: Oleg Nesterov
Date: Tue Jan 08 2013 - 13:13:28 EST


On 01/08, Srikar Dronamraju wrote:
>
> * Oleg Nesterov <oleg@xxxxxxxxxx> [2012-12-31 18:52:29]:
>
> > static void handle_swbp(struct pt_regs *regs)
> > {
> > - struct uprobe_task *utask;
> > struct uprobe *uprobe;
> > unsigned long bp_vaddr;
> > int uninitialized_var(is_swbp);
> > @@ -1512,19 +1515,12 @@ static void handle_swbp(struct pt_regs *regs)
> > if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags)))
> > goto out;
> >
> > - utask = get_utask();
> > - if (!utask)
> > - goto out; /* re-execute the instruction. */
> > -
>
> If get_utask fails with the above change, Dont we end up calling
> handler_chain twice(or more)?.

After restart, yes.

> I think this is probably true with
> previous patch too.

And this can happen with the current code too, if xol_alloc_area()
fails. So I think this is probably fine. Besides, if GFP_KERNEL
fails the task should be oom-killed in practice.

Oleg.

--
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/