diff options
author | Michael Neuling <mikey@neuling.org> | 2013-05-06 07:32:40 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-20 02:55:13 -0400 |
commit | 70a54a4faec72ee9d12b9c4dfa27bc241deb79a6 (patch) | |
tree | fbe06b1485d4241e8e9b4019163c3ca546171a64 /arch/powerpc/lib | |
parent | b9ef7d6b11c120cc402a76013062061bbe0fbaad (diff) |
powerpc: Fix single step emulation of 32bit overflowed branches
Check truncate_if_32bit() on final write to nip.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/sstep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index e15c521846ca..99c7fc16dc0d 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c | |||
@@ -580,7 +580,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
580 | if (instr & 1) | 580 | if (instr & 1) |
581 | regs->link = regs->nip; | 581 | regs->link = regs->nip; |
582 | if (branch_taken(instr, regs)) | 582 | if (branch_taken(instr, regs)) |
583 | regs->nip = imm; | 583 | regs->nip = truncate_if_32bit(regs->msr, imm); |
584 | return 1; | 584 | return 1; |
585 | #ifdef CONFIG_PPC64 | 585 | #ifdef CONFIG_PPC64 |
586 | case 17: /* sc */ | 586 | case 17: /* sc */ |