1 Apr 2005 10:37
[PATCH] Kprobes: Incorrect handling of probes on ret/lret instruction
Prasanna S Panchamukhi <prasanna <at> in.ibm.com>
2005-04-01 08:37:10 GMT
2005-04-01 08:37:10 GMT
Hi, Kprobes could not handle the insertion of a probe on the ret/lret instruction and used to oops after single stepping since kprobes was modifying eip/rip incorrectly. Adjustment of eip/rip is not required after single stepping in case of ret/lret instruction, because eip/rip points to the correct location after execution of the ret/lret instruction. This patch fixes the above problem. Signed-off-by: Prasanna S Panchamukhi <prasanna <at> in.ibm.com> --- --- linux-2.6.12-rc1-prasanna/arch/i386/kernel/kprobes.c | 7 +++++++ linux-2.6.12-rc1-prasanna/arch/x86_64/kernel/kprobes.c | 7 +++++++ 2 files changed, 14 insertions(+) diff -puN arch/i386/kernel/kprobes.c~kprobes-ret-address-fix arch/i386/kernel/kprobes.c --- linux-2.6.12-rc1/arch/i386/kernel/kprobes.c~kprobes-ret-address-fix 2005-03-31 14:32:56.000000000 +0530 +++ linux-2.6.12-rc1-prasanna/arch/i386/kernel/kprobes.c 2005-03-31 14:37:24.000000000 +0530 <at> <at> -218,6 +218,13 <at> <at> static void resume_execution(struct kpro *tos &= ~(TF_MASK | IF_MASK); *tos |= kprobe_old_eflags; break; + case 0xc3: /* ret/lret */ + case 0xcb: + case 0xc2: + case 0xca:(Continue reading)
RSS Feed