[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Copy_to_user/copy_from_user
> > > As the kernel address space in the new linux
> > > kernels spans the entire 0 to 4 GB, still why
> > > do we need to do copy_to_user or copy_from user
?
> > Because we can't be sure that the page is in
> > physical memory.
> If it's not, we'll just have to service a page
> fault; why's that a problem?
I guess the main reason for using copy_to_user() and
copy_from_user() is the range-checking done there.
User-mode code should not be allowed to pass in a
kernel-mode address to kernel functions for read/write
operations.
-Regards,
Ravi.
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/