Quote:
Originally Posted by nagarajuk
Hi,
What is the difference between the copy_to_user/copy_from_user to memcpy?
|
Please try to research and look things up on your own. From a brief Google search:
http://www.gossamer-threads.com/list.../kernel/594886
http://wiki.answers.com/Q/Difference...cpy_and_memcpy
It comes down to 'safe' access to memory, thats what copy to usr/copy from user is. It does validation on user space pointers, which memcpy often doesn't do. Try memcpy in your code in place of copy to usr; it will work if your user space pointer is valid. But, if the user space address is swapped out...see what happens then....