summaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-03-10 14:04:34 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-05-19 15:56:20 +0200
commit66e9b0717102507e64f638790eaece88765cc9e5 (patch)
tree60aabd710f537f162bd2accebd2f544b3d883565 /kernel/module.c
parent4e321b7746e54283362bfa41c833d9f9d5470a3b (diff)
kprobes: Prevent probes in .noinstr.text section
Instrumentation is forbidden in the .noinstr.text section. Make kprobes respect this. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lkml.kernel.org/r/20200505134100.179862032@linutronix.de
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index faf733789560..72ed2b3a6ee2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3150,6 +3150,9 @@ static int find_module_sections(struct module *mod, struct load_info *info)
}
#endif
+ mod->noinstr_text_start = section_objs(info, ".noinstr.text", 1,
+ &mod->noinstr_text_size);
+
#ifdef CONFIG_TRACEPOINTS
mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs",
sizeof(*mod->tracepoints_ptrs),