__sprint_symbol() is supposed to resolve the passed address to a symbol
name. If the symbol can not be resolved it will print the actual pointer
that was passed. The pointer policy is to not reveal actual pointer
values.

Backtraces used to print the address followed by the symbol name. The
address has been removed leaving just the resolved symbol. If the
pointer can not be resolved to a symbol, it shouldn't be printed as the
bare value.

Print "(unknown)" for any symbol that can not be resolved.

Cc: Namhyung Kim <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
 kernel/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index aec2f06858afd..c70adaa97c24b 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -483,7 +483,7 @@ static int __sprint_symbol(char *buffer, unsigned long 
address,
        len = kallsyms_lookup_buildid(address, &size, &offset, &modname, 
&buildid,
                                       buffer);
        if (!len)
-               return sprintf(buffer, "0x%lx", address - symbol_offset);
+               return sprintf(buffer, "(unknown)");
 
        offset -= symbol_offset;
 
-- 
2.55.0


Reply via email to