From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Kees Cook <kees@kernel.org>, Petr Mladek <pmladek@suse.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Tycho Andersen <tycho@tycho.pizza>
Subject: [PATCH v3 1/2] vsprintf: Don't leak pointers for %ps without KALLSYMS enabled
Date: Thu, 15 Oct 2026 18:06:48 +0200 [thread overview]
Message-ID: <20261015-vsprintf_kallsym-v3-1-c175c27f38b7@linutronix.de> (raw)
In-Reply-To: <20261015-vsprintf_kallsym-v3-0-c175c27f38b7@linutronix.de>
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.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1d95ab9314bf7..a3db25cc1e567 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, ptr, spec);
#endif
}
--
2.55.0
next prev parent reply other threads:[~2026-10-15 16:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 16:06 [PATCH v3 0/2] vsprintf: Don't leak pointers Sebastian Andrzej Siewior
2026-10-15 16:06 ` Sebastian Andrzej Siewior [this message]
2026-10-15 16:06 ` [PATCH v3 2/2] kallsyms: Don't leak pointers for unresolved symbols Sebastian Andrzej Siewior
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=20261015-vsprintf_kallsym-v3-1-c175c27f38b7@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=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®