Re: [PATCH 1/7] x86/entry: Fix #UD vs WARN more

From: Peter Zijlstra
Date: Thu Jun 18 2020 - 11:50:32 EST


On Thu, Jun 18, 2020 at 07:57:35AM -0700, Andy Lutomirski wrote:
>
>
> > On Jun 18, 2020, at 7:50 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> 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.