Re: WARNING: Kernel stack regs has bad 'bp' value

Josh Poimboeuf
2020-09-11T17:12:50Z

On Fri, Sep 11, 2020 at 10:14:41AM -0600, Logan Gunthorpe wrote:
>
>
> On 2020-09-11 10:00 a.m., Josh Poimboeuf wrote:
> > Hi Logan,
> >
> > Thanks for the bug report. (Sorry I missed the first one, Naresh.)
> >
> > The problem is that ret_from_fork() is no longer in .entry.text, so the
> > following check in the FP unwinder doesn't work when ret_from_fork()
> > gets interrupted.
> >
> > /*
> > * Don't warn if the unwinder got lost due to an interrupt in entry
> > * code or in the C handler before the first frame pointer got set up:
> > */
> > if (state->got_irq && in_entry_code(state->ip))
> > goto the_end;
> >
> > If you have the ability to recreate, can you try the following patch?
>
> Sorry, but I can not reliably hit this bug. I hit it randomly twice last
> week however, despite doing a bunch more runs this week, I haven't hit
> it again.
>
> I can add the patch to my testing next week but I ca not give you a
> definitive answer on whether this fixes the bug.
>
> Perhaps Naresh's test is a better reproducer.

That's ok. I forced a reproducer by putting an infinite loop in
ret_from_fork to force an APIC interrupt with lockdep unwind.

The patch fixes it, I'll post an official version after some more
testing.

--
Josh