aboutsummaryrefslogtreecommitdiff
path: root/include/linux/module.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2022-10-25 10:14:51 -0700
committerAlexei Starovoitov <ast@kernel.org>2022-10-25 10:14:51 -0700
commit31af1aa09fb9b31694a4bad7e49204c75fb6f7dc (patch)
treeb05ceb3a545093b8c8526ecd065b38e352853be2 /include/linux/module.h
parent152e60e3fa2fa383357b4bac6306e91f6b25e32c (diff)
parentb2440443a64f1b687df364089e6dcb23da4f9598 (diff)
downloadlinux-31af1aa09fb9b31694a4bad7e49204c75fb6f7dc.tar.gz
linux-31af1aa09fb9b31694a4bad7e49204c75fb6f7dc.tar.bz2
linux-31af1aa09fb9b31694a4bad7e49204c75fb6f7dc.zip
Merge branch 'bpf: Fixes for kprobe multi on kernel modules'
Jiri Olsa says: ==================== hi, Martynas reported kprobe _multi link does not resolve symbols from kernel modules, which attach by address works. In addition while fixing that I realized we do not take module reference if the module has kprobe_multi link on top of it and can be removed. There's mo crash related to this, it will silently disappear from ftrace tables, while kprobe_multi link stays up with no data. This patchset has fixes for both issues. v3 changes: - reorder fields in struct bpf_kprobe_multi_link [Andrii] - added ack [Andrii] v2 changes: - added acks (Song) - added comment to kallsyms_callback (Song) - change module_callback realloc logic (Andrii) - get rid of macros in tests (Andrii) thanks, jirka ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index ec61fb53979a..35876e89eb93 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -879,8 +879,17 @@ static inline bool module_sig_ok(struct module *module)
}
#endif /* CONFIG_MODULE_SIG */
+#if defined(CONFIG_MODULES) && defined(CONFIG_KALLSYMS)
int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
struct module *, unsigned long),
void *data);
+#else
+static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
+ struct module *, unsigned long),
+ void *data)
+{
+ return -EOPNOTSUPP;
+}
+#endif /* CONFIG_MODULES && CONFIG_KALLSYMS */
#endif /* _LINUX_MODULE_H */