aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasami Hiramatsu <hiramatu@sdl.hitachi.co.jp>2006-04-27 21:39:55 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-28 11:33:47 -0400
commitbcff5cd667da6eb3df9173626497e3e69b004e42 (patch)
tree45ce6bc37eb285bfc426000362c8b26eee2408c1
parentbf661987da6f5131475dfe3f51a98de4e2589ed3 (diff)
[PATCH] kprobe: fix resume execution on i386
Fix resume_execution() to handle iret and absolute jump opcode correctly on i386. Signed-off-by: Masami Hiramatsu <hiramatu@sdl.hitachi.co.jp> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com> Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: Yumiko Sugita <sugita@sdl.hitachi.co.jp> Cc: Satoshi Oshima <soshima@redhat.com> Cc: Hideo Aoki <haoki@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/i386/kernel/kprobes.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 6c93ddf09512..38806f427849 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -443,10 +443,11 @@ static void __kprobes resume_execution(struct kprobe *p,
443 *tos &= ~(TF_MASK | IF_MASK); 443 *tos &= ~(TF_MASK | IF_MASK);
444 *tos |= kcb->kprobe_old_eflags; 444 *tos |= kcb->kprobe_old_eflags;
445 break; 445 break;
446 case 0xc3: /* ret/lret */ 446 case 0xc2: /* iret/ret/lret */
447 case 0xcb: 447 case 0xc3:
448 case 0xc2:
449 case 0xca: 448 case 0xca:
449 case 0xcb:
450 case 0xcf:
450 case 0xea: /* jmp absolute -- eip is correct */ 451 case 0xea: /* jmp absolute -- eip is correct */
451 /* eip is already adjusted, no more changes required */ 452 /* eip is already adjusted, no more changes required */
452 p->ainsn.boostable = 1; 453 p->ainsn.boostable = 1;
@@ -454,10 +455,13 @@ static void __kprobes resume_execution(struct kprobe *p,
454 case 0xe8: /* call relative - Fix return addr */ 455 case 0xe8: /* call relative - Fix return addr */
455 *tos = orig_eip + (*tos - copy_eip); 456 *tos = orig_eip + (*tos - copy_eip);
456 break; 457 break;
458 case 0x9a: /* call absolute -- same as call absolute, indirect */
459 *tos = orig_eip + (*tos - copy_eip);
460 goto no_change;
457 case 0xff: 461 case 0xff:
458 if ((p->ainsn.insn[1] & 0x30) == 0x10) { 462 if ((p->ainsn.insn[1] & 0x30) == 0x10) {
459 /* call absolute, indirect */
460 /* 463 /*
464 * call absolute, indirect
461 * Fix return addr; eip is correct. 465 * Fix return addr; eip is correct.
462 * But this is not boostable 466 * But this is not boostable
463 */ 467 */