title: How to access user space memory from the Linux kernel?
body: <p>I know that <code>copy_to_user</code>/<code>copy_from_user</code>, <code>get_user</code>/<code>put_user</code> functions are for this purpose.</p>
  
  <p>My question is that, given a user space address/pointer, how can I access the data pointed to by the address from the kernel in general?</p>
  
  <p>I can imagine that first I have to make sure the containing page should be in physical memory (instead of in disk). </p>
  
  <p>What is the next step? Can I use <code>*p</code>, where <code>p</code> is the pointer pointing to some user space data, directly to refer to the data?</p>
  
  <p>Or do I have to first invoke <code>kmap</code> to map the containing physical page frame to the kernel virtual address space? Why?</p>