Re: [PATCH] x86/uaccess: instrument copy_from_user_nmi()

From: Peter Zijlstra
Date: Thu Oct 27 2022 - 04:06:31 EST


On Wed, Oct 26, 2022 at 11:38:53AM -0700, Alexander Potapenko wrote:
> A bigger issue from the NMI perspective is probably
> having __msan_poison_alloca() inserted in every non-noinstr kernel
> function, because that hook may acquire the stackdepot lock.

*urgghhh* that's broken, that must not be. There is a *TON* of NMI
functions that are non-noinstr.

What's worse, it seems to do a memory allocation as well, and that's out
the window with PREEMPT_RT where you can't do even GFP_ATOMIC from
regular IRQ context.

That function is wholly unacceptable to be added to every kernel
function.