Patchwork Don't emulate mr. instructions

login
register
mail settings
Submitter Ananth N Mavinakayanahalli
Date Feb. 6, 2009, 12:02 p.m.
Message ID <20090206120200.GU3695@in.ibm.com>
Download mbox | patch
Permalink /patch/22334/
State Accepted
Commit eef336189b2b5ae68bfbef0df24176a4a152d981
Headers show

Comments

Ananth N Mavinakayanahalli - Feb. 6, 2009, 12:02 p.m.
Currently emulate_step() emulates mr. instructions without updating cr0
and this can be disastrous. Don't emulate mr.

This bug has been around for a while, but I am not sure if its a worthy
-stable candidate. I'll leave it to Ben do decide.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 arch/powerpc/lib/sstep.c |    2 ++
 1 file changed, 2 insertions(+)

Patch

Index: linux-2.6.29-rc3/arch/powerpc/lib/sstep.c
===================================================================
--- linux-2.6.29-rc3.orig/arch/powerpc/lib/sstep.c
+++ linux-2.6.29-rc3/arch/powerpc/lib/sstep.c
@@ -172,6 +172,8 @@  int __kprobes emulate_step(struct pt_reg
 			}
 			break;
 		case 0x378:	/* orx */
+			if (instr & 1)
+				break;
 			rs = (instr >> 21) & 0x1f;
 			rb = (instr >> 11) & 0x1f;
 			if (rs == rb) {		/* mr */