linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: linux-mm@kvack.org
Subject: Questions about page IO of swapping
Date: Mon, 22 May 2000 13:43:53 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.10.10005221323490.21738-100000@nightmaster.csn.tu-chemnitz.de> (raw)

Hi,

I tried to implement encrypted swap and couldn't find the right
places for encryption and decryption.

I thought encryption should be done before calling brw_page() in 
mm/page_io.c:rw_swap_page_base()
and decryption in fs/buffer.c:after_unlock_page(), if the
page->count is >0 after passing every other of the tests in this
function.

But obviosly I was wrong, because I got oopses and later a
reboot, as soon as I touched swap.

So when is a page actually considered written to disk and when is
it accessed first after this? 

These would be the points for my very lightwight encrypted swap
layer.

The data can be cached, but may not be accessed
before decryption and should not go to swap (file or device)
without being encrypted. Caching should be avoided as much as
possible by calling crypto-stuff as late as possible (in the
lowest layer).

All of this is meant for kernel 2.2.15 (+kernel-int-patch[1], but
this is only used for the crypto-API).

I would like to know the entry points for 2.3.x too, but cannot
really test it, because kernel-int-patch is only for 2.2.x

If you guys have no idea, I'll try implementing a pseudo block
device, but this will restrict it to swap-devices and omits
swap-files (which could of course simulated with loopback).

I have also problems tracking reads vs. writes, because this
information is somehow lost due to generalization after a page
has been read/written ;-)

Thanks and Regards

Ingo Oeser

[1] International Kernel Patch -> Crypto stuff developed outside
   USA and outside other countries that have weird crypto laws.
-- 
Feel the power of the penguin - run linux@your.pc
<esc>:x

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

             reply	other threads:[~2000-05-22 11:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-22 11:43 Ingo Oeser [this message]
2000-06-12 14:47 ` Andrea Arcangeli

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=Pine.LNX.4.10.10005221323490.21738-100000@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=linux-mm@kvack.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