uprobes/x86: Send SIGILL if arch_uprobe_post_xol() fails
[pandora-kernel.git] / kernel / events / uprobes.c
index ea2a7c0..d1edc5e 100644 (file)
@@ -1867,10 +1867,11 @@ out:
 static void handle_singlestep(struct uprobe_task *utask, struct pt_regs *regs)
 {
        struct uprobe *uprobe;
+       int err = 0;
 
        uprobe = utask->active_uprobe;
        if (utask->state == UTASK_SSTEP_ACK)
-               arch_uprobe_post_xol(&uprobe->arch, regs);
+               err = arch_uprobe_post_xol(&uprobe->arch, regs);
        else if (utask->state == UTASK_SSTEP_TRAPPED)
                arch_uprobe_abort_xol(&uprobe->arch, regs);
        else
@@ -1884,6 +1885,11 @@ static void handle_singlestep(struct uprobe_task *utask, struct pt_regs *regs)
        spin_lock_irq(&current->sighand->siglock);
        recalc_sigpending(); /* see uprobe_deny_signal() */
        spin_unlock_irq(&current->sighand->siglock);
+
+       if (unlikely(err)) {
+               uprobe_warn(current, "execute the probed insn, sending SIGILL.");
+               force_sig_info(SIGILL, SEND_SIG_FORCED, current);
+       }
 }
 
 /*