On Thu, Nov 03, 2022 at 02:45:15PM +0100, Alexander Potapenko wrote: > There is a case in exc_invalid_op handler that is executed outside the > irqentry_enter()/irqentry_exit() region when an UD2 instruction is used > to encode a call to __warn(). > > In that case the `struct pt_regs` passed to the interrupt handler is > never unpoisoned by KMSAN (this is normally done in irqentry_enter()), > which leads to false positives inside handle_bug(). > > Use kmsan_unpoison_entry_regs() to explicitly unpoison those registers > before using them. > > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Cc: Borislav Petkov <bp@xxxxxxxxx> > Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> > Cc: Ingo Molnar <mingo@xxxxxxxxxx> > Cc: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> > Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> > Cc: x86@xxxxxxxxxx > Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx> > > --- > > v2: > - move the call to kmsan_unpoison_entry_regs() after the > instrumentation_begin(), as suggested by Peter Zijlstra Thanks! Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>