lkml.org 
[lkml]   [2005]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectcopy_from_user, copy_to_user in kernel
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

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

\
 
 \ /
  Last update: 2005-08-12 20:21    [W:0.437 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site