diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-04-22 09:20:07 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2014-04-30 13:10:36 -0400 |
commit | dd91016dfc9ba9236cb0149984da3f0434278b49 (patch) | |
tree | 8766bb4daed669ad804653cb3b43a27752719289 /arch | |
parent | b24dc8dace74708fd849312722090169c5da97d3 (diff) |
uprobes/x86: Don't change the task's state if ->pre_xol() fails
Currently this doesn't matter, the only ->pre_xol() hook can't fail,
but we need to fix arch_uprobe_pre_xol() anyway. If ->pre_xol() fails
we should not change regs->ip/flags, we should just return the error
to make restart actually possible.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Jim Keniston <jkenisto@us.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/uprobes.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index ecbffd16d090..f4464b1b9435 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -687,6 +687,12 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
687 | { | 687 | { |
688 | struct uprobe_task *utask = current->utask; | 688 | struct uprobe_task *utask = current->utask; |
689 | 689 | ||
690 | if (auprobe->ops->pre_xol) { | ||
691 | int err = auprobe->ops->pre_xol(auprobe, regs); | ||
692 | if (err) | ||
693 | return err; | ||
694 | } | ||
695 | |||
690 | regs->ip = utask->xol_vaddr; | 696 | regs->ip = utask->xol_vaddr; |
691 | utask->autask.saved_trap_nr = current->thread.trap_nr; | 697 | utask->autask.saved_trap_nr = current->thread.trap_nr; |
692 | current->thread.trap_nr = UPROBE_TRAP_NR; | 698 | current->thread.trap_nr = UPROBE_TRAP_NR; |
@@ -696,8 +702,6 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
696 | if (test_tsk_thread_flag(current, TIF_BLOCKSTEP)) | 702 | if (test_tsk_thread_flag(current, TIF_BLOCKSTEP)) |
697 | set_task_blockstep(current, false); | 703 | set_task_blockstep(current, false); |
698 | 704 | ||
699 | if (auprobe->ops->pre_xol) | ||
700 | return auprobe->ops->pre_xol(auprobe, regs); | ||
701 | return 0; | 705 | return 0; |
702 | } | 706 | } |
703 | 707 | ||