All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>, X86 ML <x86@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/5] x86/dumpstack: Cleanups and user opcode bytes Code: section
Date: Tue, 20 Feb 2018 21:44:36 +0100	[thread overview]
Message-ID: <20180220204435.GC24320@pd.tnic> (raw)
In-Reply-To: <20180220192956.si2a6m3ckskexvte@treble>

On Tue, Feb 20, 2018 at 01:29:56PM -0600, Josh Poimboeuf wrote:
> > Maybe this series already has this side-effect, but I'd really love to
> > see oopses show the code bytes for each kernel entry, not just the
> > innermode one.  We already dump full regs including RIP -- adding
> > Code: should be easy and would be very helpful.
> 
> Just to clarify, I think you want to show the Code: around regs->ip
> every time we show the registers?

It is an easy change to always dump Code: section when we dump RIP:.
I.e., something like this:

[   33.192733] BUG: unable to handle kernel NULL pointer dereference at           (null)
[   33.196510] IP: sysrq_handle_crash+0x17/0x20
[   33.196691] PGD 78b12067 P4D 78b12067 PUD 78b7f067 PMD 0 
[   33.196691] Oops: 0002 [#1] PREEMPT SMP
[   33.196691] Modules linked in:
[   33.196691] CPU: 6 PID: 3686 Comm: bash Not tainted 4.16.0-rc1+ #5
[   33.196691] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
[   33.196691] RIP: 0010:sysrq_handle_crash+0x17/0x20
[   33.196691] RSP: 0018:ffffc9000054bdf0 EFLAGS: 00010246
[   33.196691] Code: eb d1 e8 5d 17 b7 ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 e8 c6 24 bd ff c7 05 24 a2 19 01 01 00 00 00 0f ae f8 <c6> 04 25 00 00 00 00 01 c3 0f 1f 44 00 00 e8 86 21 c2 ff fb e9 
[   33.196691] RAX: 0000000000000000 RBX: 0000000000000063 RCX: 0000000000000000
[   33.196691] RDX: 0000000000000000 RSI: ffffffff8110145a RDI: 0000000000000063
[   33.196691] RBP: ffffffff82271400 R08: 0000000000000183 R09: 000000000002e771
[   33.196691] R10: 0000000000000000 R11: 0000000000000000 R12: 000000000000000a
[   33.196691] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[   33.196691] FS:  00007ffff7fdb700(0000) GS:ffff88007ed80000(0000) knlGS:0000000000000000
[   33.196691] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   33.196691] CR2: 0000000000000000 CR3: 000000007aa9e000 CR4: 00000000000406e0
[   33.196691] Call Trace:
[   33.196691]  __handle_sysrq+0x9e/0x160
[   33.196691]  write_sysrq_trigger+0x2b/0x30
[   33.196691]  proc_reg_write+0x38/0x70
[   33.196691]  __vfs_write+0x36/0x160
[   33.196691]  ? __fd_install+0x69/0x110
[   33.196691]  ? preempt_count_add+0x74/0xb0
[   33.196691]  ? _raw_spin_lock+0x13/0x30
[   33.196691]  ? set_close_on_exec+0x41/0x80
[   33.196691]  ? preempt_count_sub+0xa8/0x100
[   33.196691]  vfs_write+0xc0/0x190
[   33.196691]  SyS_write+0x64/0xe0
[   33.196691]  ? trace_hardirqs_off_thunk+0x1a/0x1c
[   33.196691]  do_syscall_64+0x70/0x130
[   33.196691]  entry_SYSCALL_64_after_hwframe+0x42/0xb7
[   33.196691] RIP: 0033:0x7ffff74b9620
[   33.196691] RSP: 002b:00007fffffffe7a8 EFLAGS: 00000246
[   33.196691] Code: ff 73 01 c3 48 8b 0d 68 98 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d bd f1 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ce 8f 01 00 48 89 04 
[   33.196691]  ORIG_RAX: 0000000000000001
[   33.196691] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007ffff74b9620
[   33.196691] RDX: 0000000000000002 RSI: 0000000000705408 RDI: 0000000000000001
[   33.196691] RBP: 0000000000705408 R08: 000000000000000a R09: 00007ffff7fdb700
[   33.196691] R10: 00007ffff77826a0 R11: 0000000000000246 R12: 00007ffff77842a0
[   33.196691] R13: 0000000000000002 R14: 0000000000000001 R15: 0000000000000000
[   33.196691] Code: eb d1 e8 5d 17 b7 ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 e8 c6 24 bd ff c7 05 24 a2 19 01 01 00 00 00 0f ae f8 <c6> 04 25 00 00 00 00 01 c3 0f 1f 44 00 00 e8 86 21 c2 ff fb e9 
[   33.196691] RIP: sysrq_handle_crash+0x17/0x20 RSP: ffffc9000054bdf0
[   33.196691] CR2: 0000000000000000
[   33.301033] ---[ end trace b97275941de8c6f4 ]---
[   33.302600] Kernel panic - not syncing: Fatal exception
[   33.304529] Kernel Offset: disabled
[   33.304973] ---[ end Kernel panic - not syncing: Fatal exception

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

  reply	other threads:[~2018-02-20 20:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 20:28 [PATCH 0/5] x86/dumpstack: Cleanups and user opcode bytes Code: section Borislav Petkov
2018-02-19 20:28 ` [PATCH 1/5] x86/dumpstack: Unify show_regs() Borislav Petkov
2018-02-19 20:28 ` [PATCH 2/5] x86/dumpstack: Carve out Code: dumping into a function Borislav Petkov
2018-02-19 20:28 ` [PATCH 3/5] x86/dumpstack: Improve opcodes dumping in the Code: section Borislav Petkov
2018-02-19 22:02   ` Josh Poimboeuf
2018-02-19 20:28 ` [PATCH 4/5] x86/dumpstack: Add loglevel argument to show_opcodes() Borislav Petkov
2018-02-19 20:28 ` [RFC PATCH 5/5] x86/fault: Dump user opcode bytes on fatal faults Borislav Petkov
2018-02-20 19:14 ` [PATCH 0/5] x86/dumpstack: Cleanups and user opcode bytes Code: section Andy Lutomirski
2018-02-20 19:29   ` Josh Poimboeuf
2018-02-20 20:44     ` Borislav Petkov [this message]
2018-02-21  9:15       ` Ingo Molnar
2018-02-21 17:54         ` Borislav Petkov
2018-02-21 21:39           ` Linus Torvalds
2018-02-22  9:23             ` Peter Zijlstra
2018-02-22 18:42               ` Linus Torvalds
2018-02-23 15:22                 ` Josh Poimboeuf
2018-02-23 20:12                   ` Eric W. Biederman
2018-02-25 11:35             ` Borislav Petkov

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=20180220204435.GC24320@pd.tnic \
    --to=bp@alien8.de \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.