kallsyms: remove unsed API lookup_symbol_attrs
authorManinder Singh <maninder1.s@samsung.com>
Fri, 26 May 2023 07:21:23 +0000 (12:51 +0530)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 26 May 2023 22:10:18 +0000 (15:10 -0700)
with commit '7878c231dae0 ("slab: remove /proc/slab_allocators")'
lookup_symbol_attrs usage is removed.

Thus removing redundant API.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
include/linux/kallsyms.h
include/linux/module.h
kernel/kallsyms.c
kernel/module/kallsyms.c

index fe3c9993b5bfe47db50143f20ad25c69d1cb888c..1037f4957caa9fc0c42942b9c547d5c1fabc97d6 100644 (file)
@@ -93,7 +93,6 @@ extern int sprint_backtrace(char *buffer, unsigned long address);
 extern int sprint_backtrace_build_id(char *buffer, unsigned long address);
 
 int lookup_symbol_name(unsigned long addr, char *symname);
-int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
 /* How and when do we show kallsyms values? */
 extern bool kallsyms_show_value(const struct cred *cred);
@@ -155,11 +154,6 @@ static inline int lookup_symbol_name(unsigned long addr, char *symname)
        return -ERANGE;
 }
 
-static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name)
-{
-       return -ERANGE;
-}
-
 static inline bool kallsyms_show_value(const struct cred *cred)
 {
        return false;
index 9e56763dff818753e54aba4334ca737abfb16751..a98e188cf37b8182b8654b3be069f93ce1d97174 100644 (file)
@@ -968,15 +968,6 @@ static inline int lookup_module_symbol_name(unsigned long addr, char *symname)
        return -ERANGE;
 }
 
-static inline int lookup_module_symbol_attrs(unsigned long addr,
-                                            unsigned long *size,
-                                            unsigned long *offset,
-                                            char *modname,
-                                            char *name)
-{
-       return -ERANGE;
-}
-
 static inline int module_get_kallsym(unsigned int symnum, unsigned long *value,
                                     char *type, char *name,
                                     char *module_name, int *exported)
index 290d8cc1943a0c0e013c57614463ee6b25f8fda8..8193e947aa10cec120a529dd6194daa480e00fdf 100644 (file)
@@ -484,34 +484,6 @@ found:
        return 0;
 }
 
-int lookup_symbol_attrs(unsigned long addr, unsigned long *size,
-                       unsigned long *offset, char *modname, char *name)
-{
-       int res;
-
-       name[0] = '\0';
-       name[KSYM_NAME_LEN - 1] = '\0';
-
-       if (is_ksym_addr(addr)) {
-               unsigned long pos;
-
-               pos = get_symbol_pos(addr, size, offset);
-               /* Grab name */
-               kallsyms_expand_symbol(get_symbol_offset(pos),
-                                      name, KSYM_NAME_LEN);
-               modname[0] = '\0';
-               goto found;
-       }
-       /* See if it's in a module. */
-       res = lookup_module_symbol_attrs(addr, size, offset, modname, name);
-       if (res)
-               return res;
-
-found:
-       cleanup_symbol_name(name);
-       return 0;
-}
-
 /* Look up a kernel symbol and return it in a text buffer. */
 static int __sprint_symbol(char *buffer, unsigned long address,
                           int symbol_offset, int add_offset, int add_buildid)
index c550d7d45f2fb560720ab398bbae79c536bc56ed..ef73ae7c89094bdad10f851489d98330bd40dc57 100644 (file)
@@ -381,34 +381,6 @@ out:
        return -ERANGE;
 }
 
-int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size,
-                              unsigned long *offset, char *modname, char *name)
-{
-       struct module *mod;
-
-       preempt_disable();
-       list_for_each_entry_rcu(mod, &modules, list) {
-               if (mod->state == MODULE_STATE_UNFORMED)
-                       continue;
-               if (within_module(addr, mod)) {
-                       const char *sym;
-
-                       sym = find_kallsyms_symbol(mod, addr, size, offset);
-                       if (!sym)
-                               goto out;
-                       if (modname)
-                               strscpy(modname, mod->name, MODULE_NAME_LEN);
-                       if (name)
-                               strscpy(name, sym, KSYM_NAME_LEN);
-                       preempt_enable();
-                       return 0;
-               }
-       }
-out:
-       preempt_enable();
-       return -ERANGE;
-}
-
 int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
                       char *name, char *module_name, int *exported)
 {