From: KrnlUsr <kdp102@yahoo.com>
To: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org
Subject: copy_from_user, copy_to_user in kernel
Date: Fri, 12 Aug 2005 11:16:23 -0700 (PDT) [thread overview]
Message-ID: <20050812181623.6814.qmail@web80214.mail.yahoo.com> (raw)
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
next reply other threads:[~2005-08-12 18:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-12 18:16 KrnlUsr [this message]
2005-08-12 18:29 ` John W. Linville
2005-08-12 20:35 ` Martijn van Oosterhout
2005-08-12 23:50 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050812181623.6814.qmail@web80214.mail.yahoo.com \
--to=kdp102@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®