[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWvrmuuTqZzhGswsFSCWxO3tuVBiJ+M4a=Negqwo1dyNA@mail.gmail.com>
Date: Thu, 18 Jun 2020 11:36:53 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Marco Elver <elver@...gle.com>,
Andrey Konovalov <andreyknvl@...gle.com>,
Mark Rutland <Mark.Rutland@....com>,
Matthew Helsley <mhelsley@...are.com>,
Steven Rostedt <rostedt@...dmis.org>, jthierry@...hat.com,
Miroslav Benes <mbenes@...e.cz>
Subject: Re: [PATCH 1/7] x86/entry: Fix #UD vs WARN more
On Thu, Jun 18, 2020 at 8:50 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Thu, Jun 18, 2020 at 07:57:35AM -0700, Andy Lutomirski wrote:
> >
> >
> > > On Jun 18, 2020, at 7:50 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> > >
> > > vmlinux.o: warning: objtool: exc_invalid_op()+0x47: call to probe_kernel_read() leaves .noinstr.text section
> > >
> > > Since we use UD2 as a short-cut for 'CALL __WARN', treat it as such.
> > > Have the bare exception handler do the report_bug() thing.
> >
> > I think you should consider inlining or noinstr-ifying report_bug()
> > too if you want to make this more bulletproof. I admit the scenario
> > where someone instruments it and it goes wrong is farfetched.
>
> How far down that rabbit hole do we go? Because then we need to noinstr
> printk, the console drivers, those will very quickly pull in lovely bits
> like PCI, USB, DRM :/
>
> At some point we have to just give up.
I wasn't imagining going far down the rabbit hole at all -- I think
that, at most, we should cover the path for when the fault wasn't a
BUG/WARN in the first place. I admit that, for #UD in particular,
this isn't a big deal, but if it were a different vector, this could
matter.
I suppose report_bug() could be split into lookup_bug() and
handle_bug(), and just lookup_bug() could be noinstr.
--Andy
Powered by blists - more mailing lists