linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: WARNING: kernel stack frame pointer at ffffffff82e03f40 in swapper:0 has bad value           (null)
Date: Tue, 13 Dec 2016 08:34:55 -0600	[thread overview]
Message-ID: <20161213143455.kj5siigmad4f3xim@treble> (raw)
In-Reply-To: <20161212230511.22dusz7bwrvmtjd3@treble>

On Mon, Dec 12, 2016 at 05:05:11PM -0600, Josh Poimboeuf wrote:
> On Mon, Dec 12, 2016 at 11:33:54PM +0100, Borislav Petkov wrote:
> > On Mon, Dec 12, 2016 at 04:11:47PM -0600, Josh Poimboeuf wrote:
> > > Yes, please.
> > 
> > Attached.
> 
> Thanks, I was able to recreate.  Will take a look tomorrow.

Figured it out.  Your config has CONFIG_PARAVIRT=n, which convinces gcc
to create the following preamble for x86_64_start_kernel():

  0000000000000124 <x86_64_start_kernel>:
   124:	4c 8d 54 24 08       	lea    0x8(%rsp),%r10
   129:	48 83 e4 f0          	and    $0xfffffffffffffff0,%rsp
   12d:	41 ff 72 f8          	pushq  -0x8(%r10)
   131:	55                   	push   %rbp
   132:	48 89 e5             	mov    %rsp,%rbp

It's an unusual pattern which aligns rsp (though in this case it's
already aligned) and saves the start_cpu() return address again on the
stack before storing the frame pointer.

The unwinder assumes the last stack frame header is at a certain offset,
but the above code breaks that assumption.  I still need to think about
the best way to fix it.

-- 
Josh

  reply	other threads:[~2016-12-13 14:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-10 16:17 WARNING: kernel stack frame pointer at ffffffff82e03f40 in swapper:0 has bad value (null) Borislav Petkov
2016-12-10 17:04 ` Josh Poimboeuf
2016-12-10 17:28   ` Borislav Petkov
2016-12-12 15:45     ` Josh Poimboeuf
2016-12-12 17:50       ` Borislav Petkov
2016-12-12 18:10         ` Josh Poimboeuf
2016-12-12 21:16           ` Josh Poimboeuf
2016-12-12 21:34             ` Borislav Petkov
2016-12-12 22:11               ` Josh Poimboeuf
2016-12-12 22:33                 ` Borislav Petkov
2016-12-12 23:05                   ` Josh Poimboeuf
2016-12-13 14:34                     ` Josh Poimboeuf [this message]
2016-12-13 16:55                       ` Andy Lutomirski
2016-12-13 17:26                         ` Josh Poimboeuf
2016-12-13 17:51                         ` 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=20161213143455.kj5siigmad4f3xim@treble \
    --to=jpoimboe@redhat.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.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;
as well as URLs for NNTP newsgroup(s).