mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* copy_from_user, copy_to_user in kernel
@ 2005-08-12 18:16 KrnlUsr
  2005-08-12 18:29 ` John W. Linville
  2005-08-12 20:35 ` Martijn van Oosterhout
  0 siblings, 2 replies; 4+ messages in thread
From: KrnlUsr @ 2005-08-12 18:16 UTC (permalink / raw)
  To: linux-kernel, linux-net

Hi

Why does copy_from/to_user routines fail if both
source and destination are in kernel space. I have a
kernel module that:

1. takes some parameters from user space via ioctl
(kernel copies arguments with copy_from_user)

2. processes command(s) from user and 

3. returns output to user with copy_to_user

now i have a kernel thread that wants to talk to same 
kernel module. basically user space programs will talk
to my kernel module with ioctl but kernel threads will
call EXPORTed routines. i'll have another set of
routines to work with these two interfaces. but can i 
have the core routines copy processed data back to
kernel thread or user space with copy_to_user. or do i
have to have some check saying if called from ioctl
call copy_to_user otherwise call memcpy?


                       user space interface
                                  ^
                   ---------------|---------------
                                  V
     kernel      <-->         kernel module
     thread


thanks


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-08-12 23:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-12 18:16 copy_from_user, copy_to_user in kernel KrnlUsr
2005-08-12 18:29 ` John W. Linville
2005-08-12 20:35 ` Martijn van Oosterhout
2005-08-12 23:50   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome