* [PATCH] kprobe: fix resume execution on i386
@ 2006-04-26 7:51 Masami Hiramatsu
0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2006-04-26 7:51 UTC (permalink / raw)
To: Andrew Morton, Ananth N Mavinakayanahalli, Keshavamurthy, Anil S,
Prasanna S Panchamukhi
Cc: SystemTAP, linux-kernel, Jim Keniston, Yumiko Sugita,
Satoshi Oshima, Hideo Aoki
Hi, Andrew
Here is a patch to fix resume_execution() to handle
iret and absolute jump opcode correctly on i386.
This patch can be applied against 2.6.17-rc2.
Best regards,
--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu@sdl.hitachi.co.jp
Signed-off-by: Masami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
kprobes.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff -Narup a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
--- a/arch/i386/kernel/kprobes.c 2006-04-21 12:23:45.000000000 +0900
+++ b/arch/i386/kernel/kprobes.c 2006-04-21 21:26:51.000000000 +0900
@@ -452,10 +452,11 @@ static void __kprobes resume_execution(s
*tos &= ~(TF_MASK | IF_MASK);
*tos |= kcb->kprobe_old_eflags;
break;
- case 0xc3: /* ret/lret */
- case 0xcb:
- case 0xc2:
+ case 0xc2: /* iret/ret/lret */
+ case 0xc3:
case 0xca:
+ case 0xcb:
+ case 0xcf:
case 0xea: /* jmp absolute -- eip is correct */
/* eip is already adjusted, no more changes required */
p->ainsn.boostable = 1;
@@ -463,10 +464,13 @@ static void __kprobes resume_execution(s
case 0xe8: /* call relative - Fix return addr */
*tos = orig_eip + (*tos - copy_eip);
break;
+ case 0x9a: /* call absolute -- same as call absolute, indirect */
+ *tos = orig_eip + (*tos - copy_eip);
+ goto no_change;
case 0xff:
if ((p->ainsn.insn[1] & 0x30) == 0x10) {
- /* call absolute, indirect */
- /*
+ /*
+ * call absolute, indirect
* Fix return addr; eip is correct.
* But this is not boostable
*/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] kprobe: fix resume execution on i386
@ 2006-04-12 10:10 Masami Hiramatsu
0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2006-04-12 10:10 UTC (permalink / raw)
To: Ananth N Mavinakayanahalli, Keshavamurthy, Anil S, SystemTAP,
Prasanna S Panchamukhi
Cc: Satoshi Oshima, Yumiko Sugita, Hideo Aoki
Hi,
Here is a patch to fix resume_execution() to handle
iret and absolute jump opcode correctly on i386.
As far as I can see, the resume_execution() still can't
handle some prefixes correctly, can it?
Best regards,
--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu@sdl.hitachi.co.jp
kprobes.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff -Narup a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
--- a/arch/i386/kernel/kprobes.c 2006-04-03 18:30:59.000000000 +0900
+++ b/arch/i386/kernel/kprobes.c 2006-04-05 16:07:47.000000000 +0900
@@ -452,10 +452,11 @@ static void __kprobes resume_execution(s
*tos &= ~(TF_MASK | IF_MASK);
*tos |= kcb->kprobe_old_eflags;
break;
- case 0xc3: /* ret/lret */
- case 0xcb:
- case 0xc2:
+ case 0xc2: /* iret/ret/lret */
+ case 0xc3:
case 0xca:
+ case 0xcb:
+ case 0xcf:
case 0xea: /* jmp absolute -- eip is correct */
/* eip is already adjusted, no more changes required */
p->ainsn.boostable = 1;
@@ -463,10 +464,13 @@ static void __kprobes resume_execution(s
case 0xe8: /* call relative - Fix return addr */
*tos = orig_eip + (*tos - copy_eip);
break;
+ case 0x9a: /* call absolute -- same as call absolute, indirect */
+ *tos = orig_eip + (*tos - copy_eip);
+ goto no_change;
case 0xff:
if ((p->ainsn.insn[1] & 0x30) == 0x10) {
- /* call absolute, indirect */
- /*
+ /*
+ * call absolute, indirect
* Fix return addr; eip is correct.
* But this is not boostable
*/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-26 7:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 7:51 [PATCH] kprobe: fix resume execution on i386 Masami Hiramatsu
-- strict thread matches above, loose matches on Subject: below --
2006-04-12 10:10 Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).