mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Kees Cook <kees@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Tycho Andersen <tycho@tycho.pizza>,
	Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH v4 2/2] kallsyms: Don't leak pointers for unresolved symbols
Date: Mon, 19 Oct 2026 17:40:53 +0200	[thread overview]
Message-ID: <20261019154053.iXYCoEV0@linutronix.de> (raw)
In-Reply-To: <atY4apm9PB_vQpKB@pathway.suse.cz>

On 2026-10-19 17:34:02 [+0200], Petr Mladek wrote:
> > --- a/kernel/kallsyms.c
> > +++ b/kernel/kallsyms.c
> > @@ -483,7 +483,8 @@ 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 snprintf_default_pointer(buffer, KSYM_SYMBOL_LEN,
> > +						(void *)(address - symbol_offset));
> 
> I do not see any obvious problem with using:
> 
> 	return snprintf(buffer, KSYM_SYMBOL_LEN, "%p",
> 			(void *)(address - symbol_offset));
> 
> What was the motivation to create a custom wrapper, please?

Overseeing the simple solution.

> Best Regards,
> Petr

Sebastian

      reply	other threads:[~2026-10-19 15:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 10:21 [PATCH v4 0/2] vsprintf: Don't leak pointers Sebastian Andrzej Siewior
2026-10-19 10:21 ` [PATCH v4 1/2] vsprintf: Don't leak pointers for %ps without KALLSYMS enabled Sebastian Andrzej Siewior
2026-10-19 15:18   ` Petr Mladek
2026-10-19 10:21 ` [PATCH v4 2/2] kallsyms: Don't leak pointers for unresolved symbols Sebastian Andrzej Siewior
2026-10-19 10:34   ` Andy Shevchenko
2026-10-19 10:50     ` Sebastian Andrzej Siewior
2026-10-19 11:05       ` Andy Shevchenko
2026-10-19 12:14         ` Sebastian Andrzej Siewior
2026-10-19 15:34   ` Petr Mladek
2026-10-19 15:40     ` Sebastian Andrzej Siewior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261019154053.iXYCoEV0@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=namhyung@kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tycho@tycho.pizza \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®