From: peterz@infradead.org
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, Andy Lutomirski <luto@kernel.org>,
Borislav Petkov <bp@alien8.de>,
Naresh Kamboju <naresh.kamboju@linaro.org>,
Logan Gunthorpe <logang@deltatee.com>
Subject: Re: [PATCH] x86/unwind/fp: Fix FP unwinding in ret_from_fork
Date: Tue, 15 Sep 2020 10:43:04 +0200 [thread overview]
Message-ID: <20200915084304.GU1362448@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <f366bbf5a8d02e2318ee312f738112d0af74d16f.1600103007.git.jpoimboe@redhat.com>
On Mon, Sep 14, 2020 at 12:04:22PM -0500, Josh Poimboeuf wrote:
> There have been some reports of "bad bp value" warnings printed by the
> frame pointer unwinder:
>
> WARNING: kernel stack regs at 000000005bac7112 in sh:1014 has bad 'bp' value 0000000000000000
>
> This warning happens when unwinding from an interrupt in
> ret_from_fork(). If entry code gets interrupted, the state of the frame
> pointer (rbp) may be undefined, which can confuse the unwinder,
> resulting in warnings like the above.
>
> There's an in_entry_code() check which normally silences such warnings
> for entry code. But in this case, ret_from_fork() is getting
> interrupted. It recently got moved out of .entry.text, so the
> in_entry_code() check no longer works.
>
> We could move it back into .entry.text, but that would break the noinstr
> validation because of the call to schedule_tail().
>
> Instead, initialize each new task's RBP to point to the task's entry
> regs via an encoded frame pointer. That will allow the unwinder to
> reach the end of the stack gracefully.
>
> Fixes: b9f6976bfb94 ("x86/entry/64: Move non entry code into .text section")
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Reported-by: Logan Gunthorpe <logang@deltatee.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
next prev parent reply other threads:[~2020-09-15 8:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 17:04 Josh Poimboeuf
2020-09-15 8:43 ` peterz [this message]
2020-09-18 8:19 ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
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=20200915084304.GU1362448@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@alien8.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=tglx@linutronix.de \
--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®