[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200915084304.GU1362448@hirez.programming.kicks-ass.net>
Date: Tue, 15 Sep 2020 10:43:04 +0200
From: peterz@...radead.org
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Logan Gunthorpe <logang@...tatee.com>
Subject: Re: [PATCH] x86/unwind/fp: Fix FP unwinding in ret_from_fork
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@...aro.org>
> Reported-by: Logan Gunthorpe <logang@...tatee.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Powered by blists - more mailing lists