Re: [PATCH 08/15] x86/alternatives: Teach text_poke_bp() to emulate instructions
From: Peter Zijlstra
Date: Tue Jun 11 2019 - 08:47:54 EST
On Tue, Jun 11, 2019 at 02:34:02PM +0200, Peter Zijlstra wrote:
> Bugger, this isn't right. It'll jump to the beginning of the trampoline,
> even if it is multiple instructions in, which would lead to executing
> instructions twice, which would be BAD.
> _maybe_, depending on what the slot looks like, we could do something
> offset = regs->ip - (unsigned long)bp_int3_addr;
> regs->ip = bp_int3_handler + offset;
> That is; jump into the slot at the same offset we hit the INT3, but this
> is quickly getting yuck.
Yeah, that won't work either... it needs something far more complex :/