On 12/21, Anton Arapov wrote:
>
> +static unsigned long uretprobe_run_handlers(struct pt_regs *regs)
> +{
> +     struct hlist_head *head;
> +     struct hlist_node *r1, *r2;
> +
> +     struct return_instance *ri;
> +     struct uprobe_task *utask;
> +
> +     struct xol_area *area;
> +     unsigned long rp_trampoline_vaddr;
> +     unsigned long orig_return_vaddr, cur_sp;
> +
> +     cur_sp = (unsigned long)regs->sp;

This depends on arch/.

BTW, this series will break the compilation on powerpc, I guess.

> +     hlist_for_each_entry_safe(ri, r1, r2, head, hlist) {
> +             if (ri->uprobe

it should never be NULL, no?

> && ri->uprobe->return_consumers)
> +                     uretprobe_handler_chain(ri->uprobe, 
> ri->orig_return_vaddr, regs);
                                                                
^^^^^^^^^^^^^^^^^
->orig_return_vaddr can be rp_trampoline_vaddr. Not sure ->handler()
wants this value ;)

> @@ -1567,12 +1625,23 @@ static void handle_swbp(struct pt_regs *regs)
>  {
>       struct uprobe_task *utask;
>       struct uprobe *uprobe;
> -     unsigned long bp_vaddr;
> +     struct xol_area *area;
> +     unsigned long bp_vaddr, orig_return_vaddr;
>       int uninitialized_var(is_swbp);
>
>       bp_vaddr = uprobe_get_swbp_addr(regs);
> -     uprobe = find_active_uprobe(bp_vaddr, &is_swbp);
> +     area = get_xol_area(current->mm);
> +     if (area) {
> +             if (bp_vaddr == area->rp_trampoline_vaddr) {
> +                     orig_return_vaddr = uretprobe_run_handlers(regs);
> +                     instruction_pointer_set(regs, orig_return_vaddr);
> +                     if (current->utask->doomed)
> +                             send_sig(SIGSEGV, current, 0);

Just move this send_sig() into uretprobe_run_handlers() and kill
the ugly utask->doomed.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to