From: Steve French <smfltc@us.ibm.com>
To: linux-kernel@vger.kernel.org
Subject: __user and iov_base
Date: 14 Jun 2004 12:53:18 -0500 [thread overview]
Message-ID: <1087235597.10368.12.camel@stevef95.austin.ibm.com> (raw)
The commonly used kernel structure iovec includes a field iov_base which
is:
void __user *iov_base
Unfortunately some of the places that use this are sockets calls from
kernel code in which it would be awkward to do extra memcpy to a user
buffer (from a kernel buffer, perhaps created in a different process)
just to avoid a sparse warning. Although it works fine to set
myiovec.iov_base = (char *)some_buffer;
this generates a warning message in the sparse tool since iov_base
includes the __user modifier, and the kernel buffer you are sending does
not..
If a buffer is never used in user space, and is potentially recycled
(via mempools) for use by more than one process, then it can't be passed
around as an __user buffer, but is it ok to simply do
myiovec.iov_base = (__user char *)some_buffer;
or is there another preferred way to handle kernel to __user
mappings/casts?
For the cifs vfs this would eliminate the last sparse warnings.
next reply other threads:[~2004-06-14 17:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-14 17:53 Steve French [this message]
2004-06-14 18:30 ` viro
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=1087235597.10368.12.camel@stevef95.austin.ibm.com \
--to=smfltc@us.ibm.com \
--cc=linux-kernel@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®