Re: Detecting kprobes generated code addresses

From: Masami Hiramatsu
Date: Sat Dec 24 2016 - 22:13:45 EST

On Thu, 22 Dec 2016 00:42:19 -0600
Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:

> Hi Masami,
> I would like to make __kernel_text_address() be able to detect whether
> an address belongs to code which was generated by kprobes. As far as I
> can tell, that information seems to be in the 'pages' lists of
> kprobe_insn_slots and kprobe_optinsn_slots. But they seem to be
> protected by mutexes.

Right. It is currently under mutex because it may kick
page allocation. But I think it is easy to fix that :)

> Do you know if there's a sleep-free way to access
> that information?

Hmm, no, I couldn't find that yet.


Masami Hiramatsu <mhiramat@xxxxxxxxxx>