linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@cs.stanford.edu>
To: linux-kernel@vger.kernel.org
Subject: is it possible to keep mmap'd memory from being synced?
Date: 01 Jul 2003 17:20:48 -0700	[thread overview]
Message-ID: <87smppye1r.fsf@pfaff.Stanford.EDU> (raw)

Is there a way to keep mmap'd memory from being synced to disk?
In particular, we're trying to build tools that operate on a lot
of data that's security-sensitive.  The data is mapped into
memory, and large parts of it are repeatedly decrypted in-place,
operated on, and then re-encrypted in-place for final storage to
disk.  During the time that the data is in plaintext form, we'd
like it to not be written to disk.

Will mlock() do what we want?  I know that it will keep the data
from being evicted from memory, but will it also keep it from
being written back to the mmap'd file?  (We're mmap'ing a real
file, not /dev/zero, etc., because we do want to keep the data
for later use.)

We don't want to use MAP_PRIVATE, both because we do want the
data eventually to get written to disk and because we have
multiple processes that want to interact doing this at once.

It seems like not decrypting in-place would be another solution,
but we'd rather not use the extra memory--we're talking about
data on the order of 100 MB or so.

I'm posting this to linux-kernel because our software already
involves a small kernel module, so if need be we're willing to
add functionality to that module to help us do what we want.
But the program's data manipulation goes on in userspace.

Thanks,

Ben.

-- 
<blp@cs.stanford.edu> <pfaffben@msu.edu> <pfaffben@debian.org> <blp@gnu.org>
 Stanford Ph.D. Candidate - MSU Alumnus - Debian Maintainer - GNU Developer
                              www.benpfaff.org


                 reply	other threads:[~2003-07-02  0:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87smppye1r.fsf@pfaff.Stanford.EDU \
    --to=blp@cs.stanford.edu \
    --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;
as well as URLs for NNTP newsgroup(s).