Re: [PATCH 5/7] uretprobes: return probe exit, invoke handlers

From: Oleg Nesterov
Date: Mon Mar 25 2013 - 08:33:54 EST


The last comment, I promise ;)

On 03/24, Oleg Nesterov wrote:
>
> On 03/22, Anton Arapov wrote:
> >
> > +static void handle_uretprobe(struct xol_area *area, struct pt_regs *regs)
> > +{
> > + struct uprobe_task *utask;
> > + struct return_instance *ri, *tmp;
> > + unsigned long prev_ret_vaddr;
> > +
> > + utask = get_utask();
> > + if (!utask)
> > + return;
> > +
> > + ri = utask->return_instances;
> > + if (!ri)
> > + return;
>
> Hmm. I am wondering what should the caller (handle_swbp) do in this
> case...

And you do not actually need get_utask(), just check current->utask.

handle_uretprobe() must not be called if either ->utask or
->return_instances is NULL. This can only happen if we have a bug,
or user-space tries to fool the kernel.

Perhaps it makes sense to add pr_warn().

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/