Linux Kernel
3.7.1
|
Go to the source code of this file.
Macros | |
#define | probe_kernel_address(addr, retval) |
Functions | |
long | probe_kernel_read (void *dst, const void *src, size_t size) |
long | __probe_kernel_read (void *dst, const void *src, size_t size) |
long notrace | probe_kernel_write (void *dst, const void *src, size_t size) |
long notrace | __probe_kernel_write (void *dst, const void *src, size_t size) |
probe_kernel_address(): safely attempt to read from a location : address to read from - its type is type typeof(retval)*
read into this variable |
Safely read from address into variable . If a kernel fault happens, handle that and return -EFAULT. We ensure that the __get_user() is executed in atomic context so that do_page_fault() doesn't attempt to take mmap_sem. This makes probe_kernel_address() suitable for use within regions where the caller already holds mmap_sem, or other locks which nest inside mmap_sem. This must be a macro because __get_user() needs to know the types of the args.
We don't include enough header files to be able to do the set_fs(). We require that the probe_kernel_address() caller will do that.