Re: copy_to_user a big memory block

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Tue Jun 20 2000 - 10:29:16 EST


On Tue, 20 Jun 2000, Daniel Olsson wrote:
[SNIPPED...]
>
> My problem is that I try to send the accounting table to a user program
> by an IOCTL call but copy_to_user fails. I have found that copy_to_user
> fails if the size is > 2976 bytes. I allocate the memory with malloc in
> the user process and the printf("%p",ptr)/printk("%p",ptr) pair shows
> that the pointer to the user space memory is correct in the module. Am I
> doing something wrong?
>
> Kind regards,
> Daniel
>

Are you trying to copy_to_user() under any kind of a lock? Make sure
the user can page-fault, remove any locks before the copy_to_user().

I routinely copy 1 - 2 megabyte images to user-space with no problem.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.36 on an i686 machine (400.59 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:20 EST