From bef5e7428f37bb879575bd106721dbfd137dad0d Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:22:59 +0100 Subject: [PATCH] Revert "kallsyms: Make kallsyms_on_each_symbol generally available" This reverts commit 9dc3580302a26a12e61415965dd5a876c036c05d. --- include/linux/kallsyms.h | 7 +------ kernel/kallsyms.c | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 430f1cefb..465060acc 100755 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -71,11 +71,11 @@ static inline void *dereference_symbol_descriptor(void *ptr) return ptr; } -#ifdef CONFIG_KALLSYMS int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, unsigned long), void *data); +#ifdef CONFIG_KALLSYMS /* Lookup the address for a symbol. Returns 0 if not found. */ unsigned long kallsyms_lookup_name(const char *name); @@ -155,11 +155,6 @@ static inline bool kallsyms_show_value(const struct cred *cred) return false; } -static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, - unsigned long), void *data) -{ - return -EOPNOTSUPP; -} #endif /*CONFIG_KALLSYMS*/ static inline void print_ip_sym(const char *loglvl, unsigned long ip) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index a55a80f39..3103629f3 100755 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -265,6 +265,7 @@ unsigned long kallsyms_lookup_name(const char *name) return module_kallsyms_lookup_name(name); } +#ifdef CONFIG_LIVEPATCH /* * Iterate over all symbols in vmlinux. For symbols from modules use * module_kallsyms_on_each_symbol instead. @@ -286,6 +287,7 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, } return 0; } +#endif /* CONFIG_LIVEPATCH */ static unsigned long get_symbol_pos(unsigned long addr, unsigned long *symbolsize,