Re: Copy_to_user/copy_from_user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> > > 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/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux