[PATCH 0/2] vsprintf: Don't leak pointers

Sebastian Andrzej Siewior posted 2 patches 1 month, 2 weeks ago
There is a newer version of this series
kernel/kallsyms.c | 2 +-
lib/vsprintf.c    | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH 0/2] vsprintf: Don't leak pointers
Posted by Sebastian Andrzej Siewior 1 month, 2 weeks ago
It is possible to leak pointers via %ps without KALLSYMS enabled.
With KALLSYMS pointers can be leaked if they can not be resolved.

The tiny series has two patches, one for each issue.

Sebastian Andrzej Siewior (2):
  vsprintf: Don't leak pointers for %ps without KALLSYMS enabled
  kallsyms: Don't leak pointers for unresolved symbols.

 kernel/kallsyms.c | 2 +-
 lib/vsprintf.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.55.0
Re: [PATCH 0/2] vsprintf: Don't leak pointers
Posted by Andrew Morton 1 month, 2 weeks ago
On Fri, 14 Aug 2026 16:48:52 +0200 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> It is possible to leak pointers via %ps without KALLSYMS enabled.
> With KALLSYMS pointers can be leaked if they can not be resolved.
> 
> The tiny series has two patches, one for each issue.
> 

Thanks.

fwiw, Sashiko flagged a few possible issues:
	https://sashiko.dev/#/patchset/20260814144854.746840-1-bigeasy@linutronix.de
Re: [PATCH 0/2] vsprintf: Don't leak pointers
Posted by Petr Mladek 1 month, 1 week ago
On Fri 2026-08-14 12:56:47, Andrew Morton wrote:
> On Fri, 14 Aug 2026 16:48:52 +0200 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> 
> > It is possible to leak pointers via %ps without KALLSYMS enabled.
> > With KALLSYMS pointers can be leaked if they can not be resolved.
> > 
> > The tiny series has two patches, one for each issue.
> > 
> 
> Thanks.
> 
> fwiw, Sashiko flagged a few possible issues:
> 	https://sashiko.dev/#/patchset/20260814144854.746840-1-bigeasy@linutronix.de

Sashiko basically complains about that this might make
dump_stack(), panics, and oopses useless on systems without KALLSYMS
which is typical on embedded systems.

IMHO, it is a good point. What about using default_pointer() resp. %p
as the fallback? It would allow to see the pointers with
"no_hash_pointers" kernel parameter.

Best Regards,
Petr
Re: [PATCH 0/2] vsprintf: Don't leak pointers
Posted by Sebastian Andrzej Siewior 1 month, 1 week ago
On 2026-08-20 17:28:25 [+0200], Petr Mladek wrote:
> On Fri 2026-08-14 12:56:47, Andrew Morton wrote:
> > On Fri, 14 Aug 2026 16:48:52 +0200 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> > 
> > > It is possible to leak pointers via %ps without KALLSYMS enabled.
> > > With KALLSYMS pointers can be leaked if they can not be resolved.
> > > 
> > > The tiny series has two patches, one for each issue.
> > > 
> > 
> > Thanks.
> > 
> > fwiw, Sashiko flagged a few possible issues:
> > 	https://sashiko.dev/#/patchset/20260814144854.746840-1-bigeasy@linutronix.de
> 
> Sashiko basically complains about that this might make
> dump_stack(), panics, and oopses useless on systems without KALLSYMS
> which is typical on embedded systems.
> 
> IMHO, it is a good point. What about using default_pointer() resp. %p
> as the fallback? It would allow to see the pointers with
> "no_hash_pointers" kernel parameter.

I didn't repost it yet. But this is what I did locally. #1 takes
no_hash_pointers into consideration and #2 is just a comment _why_ we
"leak" the actual pointer.

> Best Regards,
> Petr

Sebastian