diff options
Diffstat (limited to 'arch/i386/kernel/kprobes.c')
-rw-r--r-- | arch/i386/kernel/kprobes.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index 043f5292e70a..38806f427849 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c | |||
@@ -242,10 +242,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
242 | kcb->kprobe_status = KPROBE_REENTER; | 242 | kcb->kprobe_status = KPROBE_REENTER; |
243 | return 1; | 243 | return 1; |
244 | } else { | 244 | } else { |
245 | if (regs->eflags & VM_MASK) { | ||
246 | /* We are in virtual-8086 mode. Return 0 */ | ||
247 | goto no_kprobe; | ||
248 | } | ||
249 | if (*addr != BREAKPOINT_INSTRUCTION) { | 245 | if (*addr != BREAKPOINT_INSTRUCTION) { |
250 | /* The breakpoint instruction was removed by | 246 | /* The breakpoint instruction was removed by |
251 | * another cpu right after we hit, no further | 247 | * another cpu right after we hit, no further |
@@ -265,11 +261,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
265 | 261 | ||
266 | p = get_kprobe(addr); | 262 | p = get_kprobe(addr); |
267 | if (!p) { | 263 | if (!p) { |
268 | if (regs->eflags & VM_MASK) { | ||
269 | /* We are in virtual-8086 mode. Return 0 */ | ||
270 | goto no_kprobe; | ||
271 | } | ||
272 | |||
273 | if (*addr != BREAKPOINT_INSTRUCTION) { | 264 | if (*addr != BREAKPOINT_INSTRUCTION) { |
274 | /* | 265 | /* |
275 | * The breakpoint instruction was removed right | 266 | * The breakpoint instruction was removed right |
@@ -452,10 +443,11 @@ static void __kprobes resume_execution(struct kprobe *p, | |||
452 | *tos &= ~(TF_MASK | IF_MASK); | 443 | *tos &= ~(TF_MASK | IF_MASK); |
453 | *tos |= kcb->kprobe_old_eflags; | 444 | *tos |= kcb->kprobe_old_eflags; |
454 | break; | 445 | break; |
455 | case 0xc3: /* ret/lret */ | 446 | case 0xc2: /* iret/ret/lret */ |
456 | case 0xcb: | 447 | case 0xc3: |
457 | case 0xc2: | ||
458 | case 0xca: | 448 | case 0xca: |
449 | case 0xcb: | ||
450 | case 0xcf: | ||
459 | case 0xea: /* jmp absolute -- eip is correct */ | 451 | case 0xea: /* jmp absolute -- eip is correct */ |
460 | /* eip is already adjusted, no more changes required */ | 452 | /* eip is already adjusted, no more changes required */ |
461 | p->ainsn.boostable = 1; | 453 | p->ainsn.boostable = 1; |
@@ -463,10 +455,13 @@ static void __kprobes resume_execution(struct kprobe *p, | |||
463 | case 0xe8: /* call relative - Fix return addr */ | 455 | case 0xe8: /* call relative - Fix return addr */ |
464 | *tos = orig_eip + (*tos - copy_eip); | 456 | *tos = orig_eip + (*tos - copy_eip); |
465 | break; | 457 | break; |
458 | case 0x9a: /* call absolute -- same as call absolute, indirect */ | ||
459 | *tos = orig_eip + (*tos - copy_eip); | ||
460 | goto no_change; | ||
466 | case 0xff: | 461 | case 0xff: |
467 | if ((p->ainsn.insn[1] & 0x30) == 0x10) { | 462 | if ((p->ainsn.insn[1] & 0x30) == 0x10) { |
468 | /* call absolute, indirect */ | ||
469 | /* | 463 | /* |
464 | * call absolute, indirect | ||
470 | * Fix return addr; eip is correct. | 465 | * Fix return addr; eip is correct. |
471 | * But this is not boostable | 466 | * But this is not boostable |
472 | */ | 467 | */ |