Skip to contentSkip to conversation

kprobes: correct regs->ip value in post_hander()

PATCH Ananth N Mavinakayanahalli 2 participants 2 messages Mar 19, 2008 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 10 lines · Yakov Lerner

From: "Yakov Lerner" <[email protected]>

This patch corrects the value of regs->ip in post_handler(). Prior to this patch, post_handler() was given address meaningless to the user in regs->ip. The expected value is address of the next instruction to be executed after kprobed instruction. This patch simply swaps the order of post_handler() and resume_execution(). post_handler() now sees the corrected, expected value in regs->ip. post_handler() is now called after after resume_execution(), not before.

Quoted 3 lines

Only x86 platform was tested. Arm arch needs no changes.

Tested on powerpc.

Thanks Yakov!

#3 lore raw
In reply to a message not in the archive
Quoted 10 lines · Yakov Lerner

From: "Yakov Lerner" <[email protected]>

This patch corrects the value of regs->ip in post_handler(). Prior to this patch, post_handler() was given address meaningless to the user in regs->ip. The expected value is address of the next instruction to be executed after kprobed instruction. This patch simply swaps the order of post_handler() and resume_execution(). post_handler() now sees the corrected, expected value in regs->ip. post_handler() is now called after after resume_execution(), not before.

Quoted 3 lines

Only x86 platform was tested. Arm arch needs no changes.

Thank you, I tested this on x86-64/x86/ia64.

Signature · 7 lines
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: [email protected]