lkml.org 
[lkml]   [2022]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: CONFIG_RETHUNK int3 filling prevents kprobes in function body
On Mon, Sep 05, 2022 at 05:09:16PM +0200, Peter Zijlstra wrote:

> > This is because kprobes decodes function body to ensure the probed address
> > is an instruction boundary, and if it finds the 0xcc (int3), it stops
> > decoding and reject probing because the int3 is usually used for a
> > software breakpoint and is replacing some other instruction. Without
> > recovering the instruction, it can not continue decoding safely.
>
> I can't follow this logic. Decoding the single byte int3 instruction is
> trivial. If you want a sanity check, follow the branches you found while
> decoding the instruction starting at +0.

Specifically, kprobe is the only one scribbling random [*] instructions
with int3 in kernel text, so if kprobes doesn't know about the int3, it
must be padding.

[*] there's also static_call, jump_label and ftrace that use
text_poke_bp() to scribble instructions but those are well known
locations.

\
 
 \ /
  Last update: 2022-09-05 17:53    [W:0.103 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site