Re: copy_from_user, copy_to_user in kernel
From: Martijn van Oosterhout
Date: Fri Aug 12 2005 - 15:36:11 EST
On Fri, Aug 12, 2005 at 11:16:23AM -0700, KrnlUsr wrote:
> Hi
>
> Why does copy_from/to_user routines fail if both
> source and destination are in kernel space. I have a
> kernel module that:
I had this problem when writing a kernel module that was using a UDP
socket to send and receive stuff. It would work fine in UML but fail in
the real kernel. I never worked it out but someone later patched it by
using the [gs]et_[df]s() functions. If you grep the kernel source you
can see a lot of places use it. The problem is I still have no idea why
it works...
Hope this helps,
--
Martijn van Oosterhout <kleptog@xxxxxxxxx> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
Attachment:
pgp00000.pgp
Description: PGP signature