[lkml]   [2020]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH -tip 0/4] kprobes: Support __kprobes and NOKPROBE_SYMBOL in modules

Here is a series for adding support of __kprobes attribute
and NOKPROBE_SYMBOL() macro in modules. With this series,
kprobes user can add its handlers and sub-functions to kprobe
blacklist so that other kprobes don't probe it.

Note that user should not use both __kprobes and NOKPROBE_SYMBOL()
to same function. In that case, the function will appear twice
on the blacklist, and that is a waste of memory.

Thomas, it is easy to add ".noinstr.text" support to this series.
as same as __kprobes (.kprobes.text) support in [2/4], we can
add mod->noinstr_text_start and mod->noinstr_text_size and
register it in add_module_kprobe_blacklist().

Thank you,


Masami Hiramatsu (4):
kprobes: Lock kprobe_mutex while showing kprobe_blacklist
kprobes: Support __kprobes blacklist in modules
kprobes: Support NOKPROBE_SYMBOL() in modules
samples/kprobes: Add __kprobes and NOKPROBE_SYMBOL() for handlers.

include/linux/module.h | 6 +++
kernel/kprobes.c | 67 ++++++++++++++++++++++++++++++++++-
kernel/module.c | 7 ++++
samples/kprobes/kprobe_example.c | 6 ++-
samples/kprobes/kretprobe_example.c | 2 +
5 files changed, 85 insertions(+), 3 deletions(-)

Masami Hiramatsu (Linaro) <>

 \ /
  Last update: 2020-03-26 15:50    [W:0.040 / U:6.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site