lkml.org 
[lkml]   [2019]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2 v2] kprobe: Do not use uaccess functions to access kernel memory that can fault
On Mon, 25 Feb 2019 11:40:18 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Mon, 25 Feb 2019 17:09:45 +0900
> Masami Hiramatsu <mhiramat@kernel.org> 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?

Yes for copy_from_user_nmi(). But there are some other fundamental
functions, like __get_user(). And when we optimize the loop in
strncpy/strnlen from user in atomic, I think one nmi_access_ok() at
entry is enough.

Thank you,

--
Masami Hiramatsu <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2019-02-26 02:36    [W:1.375 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site