uaccess: reimplement probe_kernel_address() using probe_kernel_read()
[linux-2.6-block.git] / mm / maccess.c
index 34fe24759ed1f32cb58cd38d2245ae7b82dc7f37..1b13638d238d514ad7760ca680507dc8469010be 100644 (file)
  *
  * Safely read from address @src to the buffer at @dst.  If a kernel fault
  * happens, handle that and return -EFAULT.
+ *
+ * We ensure that the copy_from_user is executed in atomic context so that
+ * do_page_fault() doesn't attempt to take mmap_sem.  This makes
+ * probe_kernel_read() suitable for use within regions where the caller
+ * already holds mmap_sem, or other locks which nest inside mmap_sem.
  */
 
 long __weak probe_kernel_read(void *dst, const void *src, size_t size)