On Mon 9 June 2003 15:52, Biswaranjan wrote: > Hi, > > i'm trying to write a device driver for a particular device. > > i need to manipulate the buffer provided to the kernel during > write() > directly from the kernel without using copy_from_user() due to > efficiency reasons.. > > is there any possible way? Before of all you need to be sure that adresses covered by user supplied buffer are valid (they fall below 0xc0000000, they are included in one memory region of current process, memory access of such vma allow to read/write user supplied buffer,....). You need to be sure that a page fault never occours in kernel mode while you're reading/writing from/to user supplied buffer. Take care that: checking if user supplied buffer falls in a mapped memory region is O(Log(N)) where N = number of memory regions currently mappedby current process. I'm not very sure if this is the right way to do that.... you can try. Daniele. PGP PKEY http://pgp.mit.edu:11371/pks/lookup?search=belch76@libero.it&op=index ICQ# 104896040 Netphone/Fax 178.605.7063 Homepage http://web.tiscali.it/bellucda -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/