Re: [RFC PATCH v3 5/6] uretprobes: invoke return probe handlers

From: Oleg Nesterov
Date: Sat Mar 02 2013 - 13:11:45 EST


On 02/28, Anton Arapov wrote:
>
> @@ -1576,8 +1622,8 @@ static void handle_swbp(struct pt_regs *regs)
>
> if (!uprobe) {
> if (is_swbp > 0) {
> - /* No matching uprobe; signal SIGTRAP. */
> - send_sig(SIGTRAP, current, 0);
> + /* No matching uprobe; Try with uretprobe */
> + handle_uretprobe(regs);

Hmm. at least this looks certainly wrong.

You shifted send_sig(SIGSEGV) into handle_uretprobe(), but if nothing
else printk(KERN_ERR "uprobe: no instance found!") doesn't look nice
if we hit the regular breakoint.

In fact everything handle_uretprobe() does in this case looks wrong.
Including the fact that get_xol_area/get_utask can fail. And unwinding
looks bogus...

I think you need

if (bp_vaddr == rp_trampoline_vaddr)
handle_uretprobe()

like the previous version did.

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/