aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/uprobes.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-12-30 09:21:22 -0500
committerOleg Nesterov <oleg@redhat.com>2013-02-08 11:47:11 -0500
commitcf31ec3f7fece93f3fce3ee5964e27857141ea47 (patch)
treec2cc4c968fdd9fa0c02fb0c6f4f452a826947df4 /arch/x86/kernel/uprobes.c
parentda1816b1caeccdff04531e763bb35d7caa3ed19f (diff)
uprobes/x86: Change __skip_sstep() to actually skip the whole insn
__skip_sstep() doesn't update regs->ip. Currently this is correct but only "by accident" and it doesn't skip the whole insn. Change it to advance ->ip by the length of the detected 0x66*0x90 sequence. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'arch/x86/kernel/uprobes.c')
-rw-r--r--arch/x86/kernel/uprobes.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index c71025b67462..4e33a35d659e 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -680,8 +680,11 @@ static bool __skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
680 if (auprobe->insn[i] == 0x66) 680 if (auprobe->insn[i] == 0x66)
681 continue; 681 continue;
682 682
683 if (auprobe->insn[i] == 0x90) 683 if (auprobe->insn[i] == 0x90) {
684 regs->ip = uprobe_get_swbp_addr(regs);
685 regs->ip += i + 1;
684 return true; 686 return true;
687 }
685 688
686 break; 689 break;
687 } 690 }