Re: CONFIG_RETHUNK int3 filling prevents kprobes in function body

From: Peter Zijlstra
Date: Mon Sep 05 2022 - 11:15:32 EST


On Mon, Sep 05, 2022 at 05:09:16PM +0200, Peter Zijlstra wrote:
> On Sun, Sep 04, 2022 at 11:07:13PM +0900, Masami Hiramatsu wrote:
> > Hi Peter,
> >
> > I found that the CONFIG_RETHUNK code (path_return) fills the unused bytes
> > with int3 for padding. Unfortunately, this prevents kprobes on the function
> > body after the return code (e.g. branch blocks placed behind the return.)
>
> Prior to that CONFIG_SLS would already use "ret; int3"

FWIW, there is a compiler option pending to also stick an int3 after
every unconditional jmp.