* Questions about page IO of swapping
@ 2000-05-22 11:43 Ingo Oeser
2000-06-12 14:47 ` Andrea Arcangeli
0 siblings, 1 reply; 2+ messages in thread
From: Ingo Oeser @ 2000-05-22 11:43 UTC (permalink / raw)
To: linux-mm
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Questions about page IO of swapping
2000-05-22 11:43 Questions about page IO of swapping Ingo Oeser
@ 2000-06-12 14:47 ` Andrea Arcangeli
0 siblings, 0 replies; 2+ messages in thread
From: Andrea Arcangeli @ 2000-06-12 14:47 UTC (permalink / raw)
To: Ingo Oeser; +Cc: linux-mm
On Mon, 22 May 2000, Ingo Oeser wrote:
>I thought encryption should be done before calling brw_page() in
>mm/page_io.c:rw_swap_page_base()
only in the write case of course.
>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.
If the page->count during swapping is zero then it's going to be a
bug. You shouldn't need to check the page count.
>So when is a page actually considered written to disk and when is
>it accessed first after this?
Of course you have to encrypt on a kind of bounce page, not on the swap
cache. While decrypting you can decrypt in place instead.
>I have also problems tracking reads vs. writes, because this
I see. You can probably check if the page is uptodate or not to know if
it's a read or a write during disk completation.
Andrea
--
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-06-12 14:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-22 11:43 Questions about page IO of swapping Ingo Oeser
2000-06-12 14:47 ` Andrea Arcangeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox