From: tip-bot for Josh Poimboeuf <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: alexander@tsoy.me, linux-kernel@vger.kernel.org,
mingo@kernel.org, tglx@linutronix.de, toralf.foerster@gmx.de,
peterz@infradead.org, luto@amacapital.net,
torvalds@linux-foundation.org, luto@kernel.org,
jpoimboe@redhat.com, hpa@zytor.com
Subject: [tip:x86/pti] x86/dumpstack: Print registers for first stack frame
Date: Wed, 3 Jan 2018 08:23:04 -0800 [thread overview]
Message-ID: <tip-3ffdeb1a02be3086f1411a15c5b9c481fa28e21f@git.kernel.org> (raw)
In-Reply-To: <396f84491d2f0ef64eda4217a2165f5712f6a115.1514736742.git.jpoimboe@redhat.com>
Commit-ID: 3ffdeb1a02be3086f1411a15c5b9c481fa28e21f
Gitweb: https://git.kernel.org/tip/3ffdeb1a02be3086f1411a15c5b9c481fa28e21f
Author: Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Sun, 31 Dec 2017 10:18:07 -0600
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 3 Jan 2018 16:14:46 +0100
x86/dumpstack: Print registers for first stack frame
In the stack dump code, if the frame after the starting pt_regs is also
a regs frame, the registers don't get printed. Fix that.
Reported-by: Andy Lutomirski <luto@amacapital.net>
Tested-by: Alexander Tsoy <alexander@tsoy.me>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toralf Förster <toralf.foerster@gmx.de>
Cc: stable@vger.kernel.org
Fixes: 3b3fa11bc700 ("x86/dumpstack: Print any pt_regs found on the stack")
Link: http://lkml.kernel.org/r/396f84491d2f0ef64eda4217a2165f5712f6a115.1514736742.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/dumpstack.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index d0bb176..afbecff 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -115,6 +115,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unwind_start(&state, task, regs, stack);
stack = stack ? : get_stack_pointer(task, regs);
+ regs = unwind_get_entry_regs(&state, &partial);
/*
* Iterate through the stacks, starting with the current stack pointer.
@@ -132,7 +133,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
* - hardirq stack
* - entry stack
*/
- for (regs = NULL; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
+ for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
const char *stack_name;
if (get_stack_info(stack, task, &stack_info, &visit_mask)) {
prev parent reply other threads:[~2018-01-03 16:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-31 16:18 [PATCH 0/2] x86: PTI dumpstack fixes Josh Poimboeuf
2017-12-31 16:18 ` [PATCH 1/2] x86/dumpstack: Fix partial register dumps Josh Poimboeuf
2018-01-03 16:22 ` [tip:x86/pti] " tip-bot for Josh Poimboeuf
2017-12-31 16:18 ` [PATCH 2/2] x86/dumpstack: Print registers for first stack frame Josh Poimboeuf
2018-01-03 16:23 ` tip-bot for Josh Poimboeuf [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=tip-3ffdeb1a02be3086f1411a15c5b9c481fa28e21f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=alexander@tsoy.me \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=toralf.foerster@gmx.de \
--cc=torvalds@linux-foundation.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