From: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Jon Medhurst <tixy@linaro.org>, Will Deacon <will.deacon@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
David Howells <dhowells@redhat.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
"Tobin C . Harding" <me@tobin.cc>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Richter <tmricht@linux.ibm.com>,
akpm@linux-foundation.org, acme@kernel.org,
brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com,
stable@vger.kernel.org
Subject: Re: [PATCH -tip v2 4/7] kprobes: Replace %p with other pointer types
Date: Thu, 26 Apr 2018 22:48:24 -0400 [thread overview]
Message-ID: <20180426224824.3492232e@vmware.local.home> (raw)
In-Reply-To: <20180427113951.8e3192af570c0bae925b2a71@kernel.org>
On Fri, 27 Apr 2018 11:39:51 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:
> On Thu, 26 Apr 2018 21:13:51 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Thu, 26 Apr 2018 17:10:03 +0900
> > Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >
> > > Replace %p with appropriate pointer types (or just remove it)
> > > - Use %pS if possible
> > > - Use %px only for the function right before BUG().
> > > - Remove unneeded error message.
> >
> > I'm not sure "right before BUG()" is legitimate for using %px. Why not
> > still use %pS?
>
> Since BUG() will dump all registers and stacks which includes
> raw address information and reboot the system (means reset the
> kaslr base offset), I thought it may not add additional damage.
BUG() has been changed to print out %pS and not the address while doing
the stack dump. It only prints the address if it doesn't find a
function name. For example:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc3-test+ #48
Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014
Call Trace:
dump_stack+0x68/0x92
lockdep_rcu_suspicious+0xf7/0x100
rcu_read_lock+0x5f/0x61
__is_insn_slot_addr+0x23/0x5c
__kernel_text_address+0x4a/0x80
show_trace_log_lvl+0x157/0x296
? module_assert_mutex_or_preempt+0x4f/0x51
show_stack+0x3d/0x3f
dump_stack+0x68/0x92
__warn+0xc2/0xdd
? 0xffffffffa0026077
warn_slowpath_null+0x1d/0x1f
module_assert_mutex_or_preempt+0x4f/0x51
__module_address+0x2a/0xac
? 0xffffffffa0026077
__module_text_address+0x12/0x59
? 0xffffffffa0026077
is_module_text_address+0xe/0x16
__kernel_text_address+0x2b/0x80
? 0xffffffffa0026077
unwind_get_return_address+0x50/0x5c
>
> Anyway, for this patch we can use %pS. For the next [5/7] patch,
> I'm not sure %pS is good for dumping a stack address...
Although it now is.
-- Steve
next prev parent reply other threads:[~2018-04-27 2:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 8:08 [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-04-26 8:08 ` [PATCH -tip v2 1/7] kprobes: Make blacklist root user read only Masami Hiramatsu
2018-04-26 8:09 ` [PATCH -tip v2 2/7] kprobes: Show blacklist addresses as same as kallsyms does Masami Hiramatsu
2018-04-26 8:09 ` [PATCH -tip v2 3/7] kprobes: Show address of kprobes if " Masami Hiramatsu
2018-04-26 8:10 ` [PATCH -tip v2 4/7] kprobes: Replace %p with other pointer types Masami Hiramatsu
2018-04-27 1:13 ` Steven Rostedt
2018-04-27 2:39 ` Masami Hiramatsu
2018-04-27 2:48 ` Steven Rostedt [this message]
2018-04-27 5:07 ` Masami Hiramatsu
2018-04-26 8:10 ` [PATCH -tip v2 5/7] kprobes/x86: Fix %p uses in error messages Masami Hiramatsu
2018-04-26 8:11 ` [PATCH -tip v2 6/7] kprobes/arm: " Masami Hiramatsu
2018-04-26 8:11 ` [PATCH -tip v2 7/7] kprobes/arm64: " Masami Hiramatsu
2018-04-26 8:13 ` [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-04-26 8:40 ` Greg KH
2018-04-27 1:14 ` Steven Rostedt
2018-04-27 6:08 ` Masami Hiramatsu
2018-04-27 6:56 ` Greg KH
2018-04-27 14:51 ` Masami Hiramatsu
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=20180426224824.3492232e@vmware.local.home \
--to=rostedt@goodmis.org \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=arnd@arndb.de \
--cc=brueckner@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=schwidefsky@de.ibm.com \
--cc=stable@vger.kernel.org \
--cc=tixy@linaro.org \
--cc=tmricht@linux.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=will.deacon@arm.com \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).