x86/kprobe: Fix crash when probe cs call
Quoted 20 lines
Thanks for fixing! I have just one comment here;
[...]
Review int3_exception_notify(struct notifier_block *self, unsigned long val, void *data · line 2188
Quoted 11 lines
(quoted diff) +5
-2@@ -2180,8 +2181,14 @@ int3_exception_notify(struct notifier_block *self, unsigned long val, void *data if (regs->ip - INT3_INSN_SIZE != selftest) return NOTIFY_DONE; - - int3_emulate_call(regs, (unsigned long)&int3_selftest_callee); + /* + * As seen in int3_selftest_asm, the effective return address + * should be placed immediately after the instruction sequence + * [int3; nop; nop; nop; nop.]. Therefore, CALL_INSN_SIZE works + * perfectly well here.Nit: This explanation is somewhat wrong. alternatives only support 5-byte call. The
TEXT_POKE_MAX_OPCODE_SIZEis 5. When len == 6,alternative.cexplicitly reserves this only for0x0fprefixed Jcc.d32
Quoted 8 lines
See
alternative.cReview int3_exception_notify(struct notifier_block *self, unsigned long val, void *data · line 2191
Quoted 3 lines
(quoted diff) +0
-0/* * NOTE: crazy scheme to allow patching Jcc.d32 but not increase the size of * this thing. When len == 6 everything is prefixed with 0x0f and we map* opcode to Jcc.d8, using len to distinguish.
Quoted 1 line
*/
So we don't need to take care of 6 bytes call here.
Thanks for the correction! I'll fix it in v3 soon. --
Jinke Han
Quoted 10 lines
Others looks good to me.
Reviewed-by Masami Hiramatsu (Google) <[email protected]>BTW, can this be picked via tip tree ? or I can pick it.
Thank you,
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>