[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190702163356.205bbe14@gandalf.local.home>
Date: Tue, 2 Jul 2019 16:33:56 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Eiichi Tsukata <devel@...ukata.com>, edwintorok@...il.com,
mingo@...hat.com, bp@...en8.de, hpa@...or.com, x86@...nel.org,
linux-kernel@...r.kernel.org, Josh Poimboeuf <jpoimboe@...hat.com>,
Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [PATCH] x86/stacktrace: Do not access user space memory
unnecessarily
On Tue, 2 Jul 2019 22:18:27 +0200
Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, Jul 02, 2019 at 01:39:05PM -0400, Steven Rostedt wrote:
> > On Tue, 2 Jul 2019 11:33:55 -0400
> > Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > > On Tue, 2 Jul 2019 16:14:05 +0200 (CEST)
> > > Thomas Gleixner <tglx@...utronix.de> wrote:
> > >
> > > > On Tue, 2 Jul 2019, Peter Zijlstra wrote:
> > > >
> > > > > On Tue, Jul 02, 2019 at 02:31:51PM +0900, Eiichi Tsukata wrote:
> > > > > > Put the boundary check before it accesses user space to prevent unnecessary
> > > > > > access which might crash the machine.
> > > > > >
> > > > > > Especially, ftrace preemptirq/irq_disable event with user stack trace
> > > > > > option can trigger SEGV in pid 1 which leads to panic.
> > >
> > > Note, I'm only able to trigger this crash with the irq_disable event.
> > > The irq_enable and preempt_disable/enable events work just fine. This
> > > leads me to believe that the TRACE_IRQS_OFF macro (which uses a thunk
> > > trampoline) may have some issues and is probably the place to look at.
> >
> > I figured it out.
> >
> > It's another "corruption of the cr2" register issue. The following
>
> Arrggghhh..
>
> > patch makes the issue go away. I'm not suggesting that we use this
> > patch, but it shows where the bug lies.
> >
> > IIRC, there was patches posted before that fixed this issue. I'll go
> > look to see if I can dig them up. Was it Joel that sent them?
>
> https://lkml.kernel.org/r/20190320221534.165ab87b@oasis.local.home
Oh, I wrote the patches. No wonder I couldn't find them in my local
"patchwork". It doesn't include patches I write. But still, I
completely forgot. Better send me to the nursing home :-p
>
> I think; lemme re-read that thread.
I'll need to do that too.
-- Steve
Powered by blists - more mailing lists