Re: [PATCH v2] x86/kprobe: Fix crash when probe cs call
From: Jinke Han
Date: Tue Sep 08 2026 - 01:04:25 EST
> Thanks for fixing! I have just one comment here;
> [...]
> > @@ -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_SIZE is 5. When len == 6, alternative.c
> explicitly reserves this only for 0x0f prefixed Jcc.d32
> See alternative.c
> > /*
> > * 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.
> > */
> 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
> Others looks good to me.
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> BTW, can this be picked via tip tree ? or I can pick it.
> Thank you,
> --
> Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>