mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Andy Lutomirski <luto@kernel.org>
Cc: X86 ML <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Brian Gerst <brgerst@gmail.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>
Subject: Re: [PATCH v2 03/18] x86/dumpstack: Add get_stack_info() support for the SYSENTER stack
Date: Wed, 22 Nov 2017 13:10:44 +0100	[thread overview]
Message-ID: <20171122121044.efeorbz2zjpyedh6@pd.tnic> (raw)
In-Reply-To: <6da17fa64f393d2e341a3d0ac85a45e751b26060.1511325444.git.luto@kernel.org>

On Tue, Nov 21, 2017 at 08:43:58PM -0800, Andy Lutomirski wrote:
> get_stack_info() doesn't currently know about the SYSENTER stack, so
> unwinding will fail if we entered the kernel on the SYSENTER stack
> and haven't fully switched off.  Teach get_stack_info() about the
> SYSENTER stack.
> 
> With future patches applied that run part of the entry code on the
> SYSENTER stack and introduce an intentional BUG(), I would get:
> 
> [    3.962218] PANIC: double fault, error_code: 0x0
> ...
> [    3.963998] task: ffff88001aa18000 task.stack: ffff88001aa20000
> [    3.964526] RIP: 0010:do_error_trap+0x33/0x1c0
> [    3.964947] RSP: 0000:ffffffffff1b8f78 EFLAGS: 00010096
> [    3.965439] RAX: dffffc0000000000 RBX: ffffffffff1b8f90 RCX: 0000000000000006
> [    3.966067] RDX: ffffffff82048b20 RSI: 0000000000000000 RDI: ffffffffff1b9110
> [    3.966696] RBP: ffffffffff1b9088 R08: 0000000000000004 R09: 0000000000000000
> [    3.967316] R10: 0000000000000000 R11: fffffbffffe3723f R12: 0000000000000006
> [    3.967939] R13: 0000000000000000 R14: 0000000000000004 R15: 0000000000000000
> [    3.968565] FS:  0000000000000000(0000) GS:ffff88001ae00000(0000) knlGS:0000000000000000
> [    3.969272] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    3.969776] CR2: ffffffffff1b8f68 CR3: 0000000019308002 CR4: 00000000003606f0
> [    3.970406] Call Trace:
> [    3.970632] Code: ...
> 
> With this patch, I get:
> 
> [    4.211553] PANIC: double fault, error_code: 0x0
> ...
> [    4.213536] task: ffff88001aa18000 task.stack: ffff88001aa20000
> [    4.214059] RIP: 0010:do_error_trap+0x33/0x1c0
> [    4.214449] RSP: 0000:ffffffffff1b8f78 EFLAGS: 00010096
> [    4.214934] RAX: dffffc0000000000 RBX: ffffffffff1b8f90 RCX: 0000000000000006
> [    4.215554] RDX: ffffffff82048b20 RSI: 0000000000000000 RDI: ffffffffff1b9110
> [    4.216176] RBP: ffffffffff1b9088 R08: 0000000000000004 R09: 0000000000000000
> [    4.216793] R10: 0000000000000000 R11: fffffbffffe3723f R12: 0000000000000006
> [    4.217419] R13: 0000000000000000 R14: 0000000000000004 R15: 0000000000000000
> [    4.218046] FS:  0000000000000000(0000) GS:ffff88001ae00000(0000) knlGS:0000000000000000
> [    4.218775] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    4.219280] CR2: ffffffffff1b8f68 CR3: 00000000193da002 CR4: 00000000003606f0
> [    4.219931] Call Trace:
> [    4.220156]  <SYSENTER>
> [    4.220383]  ? async_page_fault+0x36/0x60
> [    4.220768]  ? invalid_op+0x22/0x40
> [    4.221087]  ? async_page_fault+0x36/0x60
> [    4.221442]  ? sync_regs+0x3c/0x40
> [    4.221745]  ? sync_regs+0x2e/0x40
> [    4.222051]  ? error_entry+0x6c/0xd0
> [    4.222395]  ? async_page_fault+0x36/0x60
> [    4.222748]  </SYSENTER>
> [    4.223014] Code: ...

Please clean up those oopses: remove the timestamps, registers and the
offsets from the symbol names - they only clutter the text and have no
meaning.

> 
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
>  arch/x86/include/asm/stacktrace.h |  3 +++
>  arch/x86/kernel/dumpstack.c       | 19 +++++++++++++++++++
>  arch/x86/kernel/dumpstack_32.c    |  6 ++++++
>  arch/x86/kernel/dumpstack_64.c    |  6 ++++++
>  4 files changed, 34 insertions(+)

With that:

Reviewed-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  reply	other threads:[~2017-11-22 12:11 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22  4:43 [PATCH v2 00/18] Entry stack switching Andy Lutomirski
2017-11-22  4:43 ` [PATCH v2 01/18] x86/entry/64: Fix entry_SYSCALL_64_after_hwframe IRQ tracing Andy Lutomirski
2017-11-22  5:35   ` Ingo Molnar
2017-11-22  7:45   ` [tip:x86/urgent] x86/entry/64: Fix entry_SYSCALL_64_after_hwframe() " tip-bot for Andy Lutomirski
2017-11-22  4:43 ` [PATCH v2 02/18] x86/asm/64: Allocate and enable the SYSENTER stack Andy Lutomirski
2017-11-22  4:43 ` [PATCH v2 03/18] x86/dumpstack: Add get_stack_info() support for " Andy Lutomirski
2017-11-22 12:10   ` Borislav Petkov [this message]
2017-11-22  4:43 ` [PATCH v2 04/18] x86/gdt: Put per-cpu GDT remaps in ascending order Andy Lutomirski
2017-11-22 11:05   ` Borislav Petkov
2017-11-22 15:26     ` Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 05/18] x86/fixmap: Generalize the GDT fixmap mechanism Andy Lutomirski
2017-11-22 15:33   ` Borislav Petkov
2017-11-22 17:16     ` Andy Lutomirski
2017-11-22 17:32       ` Borislav Petkov
2017-11-23 15:24         ` Andy Lutomirski
2017-11-23 19:24   ` Thomas Gleixner
2017-11-22  4:44 ` [PATCH v2 06/18] x86/kasan/64: Teach KASAN about the cpu_entry_area Andy Lutomirski
2017-11-22  6:19   ` Ingo Molnar
2017-11-22  9:05   ` Andrey Ryabinin
2017-11-22 15:22     ` Andy Lutomirski
2017-11-23 10:08       ` Andrey Ryabinin
2017-11-23 15:22         ` Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 07/18] x86/asm: Fix assumptions that the HW TSS is at the beginning of cpu_tss Andy Lutomirski
2017-11-22 19:06   ` Borislav Petkov
2017-11-22  4:44 ` [PATCH v2 08/18] x86/dumpstack: Handle stack overflow on all stacks Andy Lutomirski
2017-11-23 11:19   ` Borislav Petkov
2017-11-22  4:44 ` [PATCH v2 09/18] x86/asm: Move SYSENTER_stack to the beginning of struct tss_struct Andy Lutomirski
2017-11-23 12:00   ` Borislav Petkov
2017-11-23 13:16   ` Denys Vlasenko
2017-11-23 15:02     ` Andy Lutomirski
2017-11-23 19:30   ` Thomas Gleixner
2017-11-22  4:44 ` [PATCH v2 10/18] x86/asm: Remap the TSS into the cpu entry area Andy Lutomirski
2017-11-23 19:32   ` Thomas Gleixner
2017-11-23 19:55   ` Borislav Petkov
2017-11-23 20:15     ` Andy Lutomirski
2017-11-23 20:37       ` Borislav Petkov
2017-11-24  2:40         ` Andy Lutomirski
2017-11-24  4:17           ` Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 11/18] x86/asm/64: Separate cpu_current_top_of_stack from TSS.sp0 Andy Lutomirski
2017-11-23 19:34   ` Thomas Gleixner
2017-11-22  4:44 ` [PATCH v2 12/18] x86/espfix/64: Stop assuming that pt_regs is on the entry stack Andy Lutomirski
2017-11-23 19:36   ` Thomas Gleixner
2017-11-22  4:44 ` [PATCH v2 13/18] x86/asm/64: Use a percpu trampoline stack for IDT entries Andy Lutomirski
2017-11-23 23:44   ` Thomas Gleixner
2017-11-24  4:14     ` Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 14/18] x86/asm/64: Return to userspace from the trampoline stack Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 15/18] x86/entry/64: Create a percpu SYSCALL entry trampoline Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 16/18] x86/irq: Remove an old outdated comment about context tracking races Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 17/18] x86/irq/64: In the stack overflow warning, print the offending IP Andy Lutomirski
2017-11-22  4:44 ` [PATCH v2 18/18] x86/entry/64: Move the IST stacks into cpu_entry_area Andy Lutomirski
2017-11-22  6:22 ` [PATCH v2 00/18] Entry stack switching Ingo Molnar
2017-11-22  6:36   ` Ingo Molnar
2017-11-22 16:23   ` Andy Lutomirski
2017-11-23  6:21     ` Ingo Molnar
2017-11-23  6:44       ` Ingo Molnar
2017-11-23  6:58         ` Ingo Molnar
2017-11-23 15:29           ` Andy Lutomirski
2017-11-23 16:41             ` Thomas Gleixner
2017-11-22  7:39 ` WARNING: can't dereference registers at ffffc90004dfff60 for ip error_entry+0x7d/0xd0 (Re: [PATCH v2 00/18] Entry stack switching) Ingo Molnar
2017-11-22  7:43   ` Ingo Molnar
2017-11-22 13:55   ` Josh Poimboeuf
2017-11-22 15:19     ` Andy Lutomirski
2017-11-22 15:56       ` Ingo Molnar
2017-11-22 16:35         ` Andy Lutomirski

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=20171122121044.efeorbz2zjpyedh6@pd.tnic \
    --to=bp@suse.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --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

all inboxes | Powered by JetHome®