aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/uprobes.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index f4464b1b9435..b3c2a92cce6c 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -394,6 +394,7 @@ struct uprobe_xol_ops {
394 bool (*emulate)(struct arch_uprobe *, struct pt_regs *); 394 bool (*emulate)(struct arch_uprobe *, struct pt_regs *);
395 int (*pre_xol)(struct arch_uprobe *, struct pt_regs *); 395 int (*pre_xol)(struct arch_uprobe *, struct pt_regs *);
396 int (*post_xol)(struct arch_uprobe *, struct pt_regs *); 396 int (*post_xol)(struct arch_uprobe *, struct pt_regs *);
397 void (*abort)(struct arch_uprobe *, struct pt_regs *);
397}; 398};
398 399
399static inline int sizeof_long(void) 400static inline int sizeof_long(void)
@@ -444,9 +445,15 @@ static int default_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs
444 return 0; 445 return 0;
445} 446}
446 447
448static void default_abort_op(struct arch_uprobe *auprobe, struct pt_regs *regs)
449{
450 handle_riprel_post_xol(auprobe, regs, NULL);
451}
452
447static struct uprobe_xol_ops default_xol_ops = { 453static struct uprobe_xol_ops default_xol_ops = {
448 .pre_xol = default_pre_xol_op, 454 .pre_xol = default_pre_xol_op,
449 .post_xol = default_post_xol_op, 455 .post_xol = default_post_xol_op,
456 .abort = default_abort_op,
450}; 457};
451 458
452static bool branch_is_call(struct arch_uprobe *auprobe) 459static bool branch_is_call(struct arch_uprobe *auprobe)
@@ -820,10 +827,11 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
820{ 827{
821 struct uprobe_task *utask = current->utask; 828 struct uprobe_task *utask = current->utask;
822 829
823 current->thread.trap_nr = utask->autask.saved_trap_nr; 830 if (auprobe->ops->abort)
824 handle_riprel_post_xol(auprobe, regs, NULL); 831 auprobe->ops->abort(auprobe, regs);
825 instruction_pointer_set(regs, utask->vaddr);
826 832
833 current->thread.trap_nr = utask->autask.saved_trap_nr;
834 regs->ip = utask->vaddr;
827 /* clear TF if it was set by us in arch_uprobe_pre_xol() */ 835 /* clear TF if it was set by us in arch_uprobe_pre_xol() */
828 if (!utask->autask.saved_tf) 836 if (!utask->autask.saved_tf)
829 regs->flags &= ~X86_EFLAGS_TF; 837 regs->flags &= ~X86_EFLAGS_TF;