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

Peter Zijlstra
2020-06-18T15:50:32Z

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