-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Jul 06, 2007 at 12:57:53PM +0530, Bhanu Kalyan Chetlapalli wrote: > On 7/6/07, hari krishna angadi <reachtohari@xxxxxxxxx> wrote: > >hi all, > > In driver module i am using copy_to_user.i > >have a user module,ths user module i pushed to hernel > >and mafe as a driver module however copy_to_user works > >but if i use memcpy() will be better ? whether memcpy > >is efficient ? > > copy_to_user is used in lieu of memcpy, only if the destination > address/location is provided by the user. This is necessary to > overcome attempts by malicious users to overwrite parts of the kernel > or other places where they typically do not have access to. Another > advantage is that the user space buffer might have been paged out, and > so must be retrieved back into the RAM. Or for architectures that don't have user space memory mapped into the kernel VM (think x86 with 4G/4G memory split). Erik - -- They're all fools. Don't worry. Darwin may be slow, but he'll eventually get them. -- Matthew Lammers in alt.sysadmin.recovery -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGjgr1/PlVHJtIto0RAp1tAJ4leu3wYH8HJbg2GZBKObKFzQbkcACeIAkv a1mxkDNV0o3OQLudVYeHN1c= =7gAP -----END PGP SIGNATURE----- -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ