I know that copy_to_user
/copy_from_user
, get_user
/put_user
functions are for this purpose.
My question is that, given
The pointer alone is not enough! You need to know which process that pointer "belongs" to.
When the process gets preempted, the pointer points into the address space of another process. The address may not be mapped any more, yadda yadda,
If that process will be the current process when you access the data, then you should use the copy_to_user/copy_from_user functions.
If the process may be scheduled out, you can try to mlock() the page in RAM and find out which is the physical ram address of the page. Whenever you want to access it, you map that physical page into a kernel virtual address.
NOTE: