From: Andrei Vagin <avagin@virtuozzo.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [2/2] x86/unwind: Make CONFIG_UNWINDER_ORC=y the default in kconfig for 64-bit
Date: Thu, 19 Oct 2017 23:54:15 -0700 [thread overview]
Message-ID: <20171020065414.GA22860@outlook.office365.com> (raw)
In-Reply-To: <20171020012804.vbqsrajia3ficwzm@treble>
On Thu, Oct 19, 2017 at 08:28:04PM -0500, Josh Poimboeuf wrote:
> On Thu, Oct 19, 2017 at 03:35:22PM -0700, Andrei Vagin wrote:
> > On Thu, Oct 19, 2017 at 01:16:55PM -0500, Josh Poimboeuf wrote:
> > > On Thu, Oct 19, 2017 at 09:51:04AM -0700, Andrei Vagin wrote:
> > > > Hi,
> > > >
> > > > We run CRIU tests for tip/auto-latest regularly, and a few days ago our
> > > > test job started to detect this warning in a kernel log:
> > > >
> > > > [ 44.235786] WARNING: can't dereference iret registers at ffff8801c5f17fe0 for ip ffffffff95f0d94b
> > > >
> > > > What does it mean? How critical is it?
> > > >
> > > > Our test job fails if it detects any warning in a kernel log. Maybe we
> > > > need to investigate reasons of this warning and try to eliminate it?
> > > >
> > > > Here are logs:
> > > > https://travis-ci.org/avagin/linux/jobs/289676634
> > >
> > > I think it means the unwinder found some bad ORC unwinder metadata. Any
> > > chance you have access to the kernel binary? I need to know what code
> > > corresponds to that ffffffff95f0d94b address.
> > >
> > > Or if you can reproduce with the following patch, that should help:
> > >
> > >
> > > diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
> > > index 570b70d3f604..95b633f0ce51 100644
> > > --- a/arch/x86/kernel/unwind_orc.c
> > > +++ b/arch/x86/kernel/unwind_orc.c
> > > @@ -448,7 +448,7 @@ bool unwind_next_frame(struct unwind_state *state)
> > >
> > > case ORC_TYPE_REGS_IRET:
> > > if (!deref_stack_regs(state, sp, &state->ip, &state->sp, false)) {
> > > - orc_warn("can't dereference iret registers at %p for ip %p\n",
> > > + orc_warn("can't dereference iret registers at %p for ip %pB\n",
> > > (void *)sp, (void *)orig_ip);
> > > goto done;
> > > }
> >
> > I applied your patch and rerun tests.
> >
> > [ 44.947699] WARNING: can't dereference iret registers at ffff880178f5ffe0 for ip int3+0x5b/0x60
>
> Thanks, that was enough for me to figure it out. Can you test the below fix?
This patch works for me. I run tests a few times and they found nothing
suspicious.
Tested-by: Andrei Vagin <avagin@virtuozzo.com>
Thank you!
>
> > and now here is a warning from kasan:
> >
> > [ 477.775676] ==================================================================
> > [ 477.775845] BUG: KASAN: stack-out-of-bounds in deref_stack_reg+0x11d/0x150
>
> The KASAN warning is a known issue for which the fix is a little more
> complicated. v1 of the patch was here:
>
> https://lkml.kernel.org/r/cover.1507128293.git.jpoimboe@redhat.com
>
>
>
> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> index 49167258d587..f6cdb7a1455e 100644
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -808,7 +808,7 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
>
> .macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
> ENTRY(\sym)
> - UNWIND_HINT_IRET_REGS offset=8
> + UNWIND_HINT_IRET_REGS offset=\has_error_code*8
>
> /* Sanity check */
> .if \shift_ist != -1 && \paranoid == 0
>
next prev parent reply other threads:[~2017-10-20 6:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171013052544.euk7yawni47lhmdq@gmail.com>
2017-10-13 20:02 ` [PATCH 1/2] x86/unwind: Rename unwinder config options to 'CONFIG_UNWINDER_*' Josh Poimboeuf
2017-10-14 10:49 ` [tip:x86/asm] " tip-bot for Josh Poimboeuf
2017-10-13 20:02 ` [PATCH 2/2] x86/unwind: Make CONFIG_UNWINDER_ORC=y the default in kconfig for 64-bit Josh Poimboeuf
2017-10-14 10:50 ` [tip:x86/asm] " tip-bot for Josh Poimboeuf
2017-10-19 16:51 ` [2/2] " Andrei Vagin
2017-10-19 18:16 ` Josh Poimboeuf
2017-10-19 22:35 ` Andrei Vagin
2017-10-20 0:38 ` Andrei Vagin
2017-10-20 1:28 ` Josh Poimboeuf
2017-10-20 6:54 ` Andrei Vagin [this message]
2018-03-19 18:57 ` [PATCH 2/2] " Matthias Kaehlcke
2018-03-19 19:29 ` Josh Poimboeuf
2018-03-19 20:31 ` Matthias Kaehlcke
2018-03-19 21:20 ` Josh Poimboeuf
2018-03-19 23:22 ` Matthias Kaehlcke
2018-03-20 2:28 ` Josh Poimboeuf
2018-03-20 19:39 ` Matthias Kaehlcke
2018-03-21 2:45 ` Josh Poimboeuf
2018-03-21 21:19 ` Matthias Kaehlcke
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=20171020065414.GA22860@outlook.office365.com \
--to=avagin@virtuozzo.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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®