Re: Re: Avoiding copy_from_user

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

 



Hi,

is it by anyway possible to find out the
struct page* corresponding to the address
of the user space buffer.

if thats possible i'm thinking of using
kmap() to map that page to the kernel space.
then i should be able to manipulate the buffer
from kernel space. is it right..?

i found a function in mm/memory.c
struct page * vmalloc_to_page(void * vmalloc_addr)
thats able to return the struct page* corresponding
to a virtual address. but i think this function is
valid only for kernel address..?

TIA,

john



On Tue, 10 Jun 2003 Angelo Dell'Aera wrote :
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 9 Jun 2003 13:52:39 -0000
"Biswaranjan  " <biswaranjan_p@rediffmail.com> 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..


If you are searching for efficiency maybe the best thing you can do is
to call access_ok() on the user space buffer just the first time you
use it and then use __copy_form_user() which is faster than
copy_from_user() since it doesn't perform this kind of test. This is
surely the best you can do AFAIK.


Regards.

- --

Angelo Dell'Aera 'buffer'
Antifork Research, Inc.	  	http://buffer.antifork.org

PGP information in e-mail header


-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+5RmXpONIzxnBXKIRAlrsAKDDM5Ye8q3A7ndOBDkyv4EQlBb+kgCbB33Z

XesmqvZ0PeuaxWEyz+buetk=
=RPWU
-----END PGP SIGNATURE-----

___________________________________________________ Get www. mycompany .com and 5 matching email ids. Just Rs. 1499/ year. Click here http://www.rediffmailpro.com

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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