Re: [PATCH v5 2/2] kallsyms: Don't leak pointers for unresolved symbols
From: Andy Shevchenko
Date: Sat Oct 24 2026 - 06:07:19 EST
On Fri, Oct 23, 2026 at 06:46:24PM +0200, Sebastian Andrzej Siewior wrote:
> __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.
> For post-mortem analysis the pointer in the backtrace shouldn't be
> relevant. In BUG(), WARN() and panic() related backtraces the PC
> register will contain the actual value. This affects passed pointers and
> callchain content since it is not part of the register dump.
>
> Use %p for the hashed pointer output if the pointer has not been
> resolved.
...
> - return sprintf(buffer, "0x%lx", address - symbol_offset);
> + return sprintf(buffer, "0x%p", address - symbol_offset);
Hmm... Do we need a 0x here? I believe it's embedded into %p output, no?
--
With Best Regards,
Andy Shevchenko