Re: [PATCH 1/2 v2] kprobe: Do not use uaccess functions to access kernel memory that can fault

From: Steven Rostedt
Date: Mon Feb 25 2019 - 11:40:24 EST


On Mon, 25 Feb 2019 17:09:45 +0900
Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

> > This should probably go with whatever effort makes nmi_uaccess_ok()
> > available on all architectures. That being said, how about just
> > making copy_from_user_nmi() work on all architectures, even if it just
> > fails unconditionally on some of them?
>
> I think even if we have copy_from_user_nmi(), we need something like
> nmi_uaccess_ok() because without it we can not correctly use
> __copy_from_user_inatomic()...

But wouldn't that just be part of the implementation of
"copy_from_user_nmi()" as being in an NMI just assumes being inatomic?

-- Steve