Skip to content

kprobes: Support __kprobes and NOKPROBE_SYMBOL in modules

Masami Hiramatsu lkml 1 version New

Get series with b4
b4 am 158523416289.24735.10455512519475919061.stgit@devnote2

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4kprobes: Lock kprobe_mutex while showing kprobe_blacklistkernel/kprobes.c+7 -10 replies
2/4kprobes: Support __kprobes blacklist in modulesinclude/linux/module.h kernel/kprobes.c kernel/module.c+50 -00 replies
3/4kprobes: Support NOKPROBE_SYMBOL() in modulesinclude/linux/module.h kernel/kprobes.c kernel/module.c+22 -00 replies
4/4samples/kprobes: Add __kprobes and NOKPROBE_SYMBOL() for handlers.samples/kprobes/kprobe_example.c samples/kprobes/kretprobe_example.c+6 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH -tip 0/4] kprobes: Support __kprobes and NOKPROBE_SYMBOL in modules

Hi,

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) <[email protected]>