From: Steven Rostedt <rostedt@goodmis.org>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Vinay Venkataraghavan <raghavanvinay@yahoo.com>,
linux-kernel@vger.kernel.org
Subject: Re: copy_from_user/copy_to_user question
Date: Fri, 02 Dec 2005 21:02:26 -0500 [thread overview]
Message-ID: <1133575346.4894.7.camel@localhost.localdomain> (raw)
In-Reply-To: <20051203013833.GG27946@ftp.linux.org.uk>
On Sat, 2005-12-03 at 01:38 +0000, Al Viro wrote:
> On Fri, Dec 02, 2005 at 08:09:59PM -0500, Steven Rostedt wrote:
> > > Secondly, they seem to use memcpy as opposed to using
> > > copy_to_user/copy_from_user which is also very
> > > dangerous.
> >
> > If they are grabbing data from user context into kernel (or vise versa)
> > that could easily cause an oops. Not to mention it is a security risk.
>
> Not to mention it simply won't work on a many platforms, no matter what...
Hmm, I've only worked with a few platforms (i386, x86_64, ppc, mips, and
a little arm but I don't remember that much). I believe that a memcpy
could work on all these platforms (error prone of course, but if the
memory is mapped its OK). When entering a system call, the kernel still
has access to the memory locations assigned to the user.
It's been a while since I had to deal with the semantics of
copy_to/from_user. So what platforms can not access a user space area
directly. Is there a special assembly command to use to copy from user?
I haven't dealt (yet) with the copy_user of x86_64. Is there a problem
when one tries to copy to/from a 32 bit address while in a 64 bit
address space?
Just curious, sorry for my ignorance here.
-- Steve
next prev parent reply other threads:[~2005-12-03 2:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-02 22:40 copy_from_user/copy_to_user question Vinay Venkataraghavan
2005-12-03 1:09 ` Steven Rostedt
2005-12-03 1:38 ` Al Viro
2005-12-03 2:02 ` Steven Rostedt [this message]
2005-12-03 2:11 ` Vinay Venkataraghavan
2005-12-03 2:22 ` Vinay Venkataraghavan
2005-12-03 2:27 ` Steven Rostedt
2005-12-03 8:33 ` Arjan van de Ven
2005-12-03 9:43 ` Heiko Carstens
2005-12-03 12:14 ` Steven Rostedt
2005-12-03 22:33 ` Andi Kleen
2005-12-05 13:31 ` linux-os (Dick Johnson)
[not found] <5fv0G-3kS-11@gated-at.bofh.it>
[not found] ` <5fvam-3vP-9@gated-at.bofh.it>
2005-12-03 2:47 ` Robert Hancock
2005-12-03 3:23 ` Steven Rostedt
2005-12-03 3:33 ` Robert Hancock
2005-12-03 4:53 ` Steven Rostedt
2005-12-03 22:35 ` Andi Kleen
2005-12-03 18:26 ` Steven Rostedt
2005-12-06 17:53 ` Vinay Venkataraghavan
2005-12-06 17:56 ` Arjan van de Ven
2005-12-06 18:23 ` Steven Rostedt
2005-12-06 18:23 ` linux-os (Dick Johnson)
2005-12-06 18:42 ` Steven Rostedt
2005-12-06 19:58 ` linux-os (Dick Johnson)
2005-12-06 20:05 ` Vinay Venkataraghavan
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=1133575346.4894.7.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raghavanvinay@yahoo.com \
--cc=viro@ftp.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.