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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 15 Feb 2019 18:14:21 -0800
Andy Lutomirski <luto@xxxxxxxxxxxxxx> 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



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux