lkml.org 
[lkml]   [2019]   [Feb]   [15]   [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 Fri, 15 Feb 2019 18:14:21 -0800
Andy Lutomirski <luto@amacapital.net> wrote:

> > In the uprobes case, we have:
> >
> > static nokprobe_inline int
> > probe_mem_read(void *dest, void *src, size_t size)
> > {
> > void __user *vaddr = (void __force __user *)src;
> >
> > return copy_from_user(dest, vaddr, size) ? -EFAULT : 0;
> > }
> >
> > Because that is adding probes on userspace code.
> >
> >
>
> Can the kprobe case call probe_kernel_read? Maybe it does already?

Yes, the probe_mem_read() is only used in the trace_probe_tmpl.h which
for uprobes is the above "copy_from_user()" and for the kprobes case it
is probe_kernel_read().

-- Steve

\
 
 \ /
  Last update: 2019-02-16 03:22    [W:0.129 / U:0.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site