[PATCH v5 1/2] vsprintf: Don't leak pointers for %ps without KALLSYMS enabled
From: Sebastian Andrzej Siewior
Date: Fri Oct 23 2026 - 12:50:07 EST
The "%ps" format modifier prints the name of the symbol which is more
valuable in terms of debugging and does not leak the actual pointer.
Without KALLSYMS it will leak the pointer which is not intended. The
default policy for pointers is to print a hashed value and not to leak
the actual pointer.
Print a hashed pointer for any symbol resolution witout KALLSYMS
enabled like it is the case for %p.
Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1d95ab9314bf7..40565c857913d 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1008,7 +1008,7 @@ char *symbol_string(char *buf, char *end, void *ptr,
return string_nocheck(buf, end, sym, spec);
#else
- return special_hex_number(buf, end, value, sizeof(void *));
+ return default_pointer(buf, end, (void *)value, spec);
#endif
}
--
2.55.0