[tip:perf/core] uprobes/x86: Change __skip_sstep() to actually skip the whole insn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  cf31ec3f7fece93f3fce3ee5964e27857141ea47
Gitweb:     http://git.kernel.org/tip/cf31ec3f7fece93f3fce3ee5964e27857141ea47
Author:     Oleg Nesterov <oleg@xxxxxxxxxx>
AuthorDate: Sun, 30 Dec 2012 15:21:22 +0100
Committer:  Oleg Nesterov <oleg@xxxxxxxxxx>
CommitDate: Fri, 8 Feb 2013 17:47:11 +0100

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@xxxxxxxxxx>
Acked-by: Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx>
---
 arch/x86/kernel/uprobes.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index c71025b..4e33a35d 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)
 		if (auprobe->insn[i] == 0x66)
 			continue;
 
-		if (auprobe->insn[i] == 0x90)
+		if (auprobe->insn[i] == 0x90) {
+			regs->ip = uprobe_get_swbp_addr(regs);
+			regs->ip += i + 1;
 			return true;
+		}
 
 		break;
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux