mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clemens Kolbitsch <clemens.kol@gmx.at>
To: linux-kernel@vger.kernel.org
Subject: Copy large memory regions from & to userspace
Date: Fri, 31 Aug 2007 00:29:20 +0200	[thread overview]
Message-ID: <200708310029.20734.clemens.kol@gmx.at> (raw)

Hi!
Just a short question: What is the correct method of copying large areas of 
memory from userspace into userspace when running in kernel-mode?

According to just about any type of documentation out there something like

unsigned long *from = 0x08000000;
unsigned long *to = 0x09000000;
memcpy(to, from, 0x1000);

should be avoided as copy_from_user, put_user, etc. should be used instead...

Is there a third set of functions for direct from-userspace-to-userspace 
copying or is it legitimate to assure that the first bytes in the from & to 
memory areas are available and then just do the plain memcpy?

Maybe there is a simple "just use the xxx function-set" answer to that, that i 
just have not ran into yet :-)

Thanks!

             reply	other threads:[~2007-08-30 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 22:29 Clemens Kolbitsch [this message]
     [not found] ` <9b53a56d0708310625q14defcb1l98ab8ce1df2c8fd7@mail.gmail.com>
2007-08-31 13:45   ` Clemens Kolbitsch
     [not found] <fa.0TqRgC3Smn96vb+Bwv5QRWKBTQg@ifi.uio.no>
     [not found] ` <fa.x2L04usZZxVIMYSdrufu+Hen9aY@ifi.uio.no>
     [not found]   ` <fa.tMlh7ZYvNMxPEL69Eww8ErwDEmw@ifi.uio.no>
2007-09-01  1:48     ` Robert Hancock
2007-09-01  6:10       ` Jan Engelhardt

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=200708310029.20734.clemens.kol@gmx.at \
    --to=clemens.kol@gmx.at \
    --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®