linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4 and cryptofs on raid1 - what will be cached and how many times
@ 2003-03-02 10:56 Vlad Harchev
  2003-03-03  9:38 ` Vlad Harchev
  0 siblings, 1 reply; 7+ messages in thread
From: Vlad Harchev @ 2003-03-02 10:56 UTC (permalink / raw)
  To: linux-kernel

Hello, 

Could you please answer the following question:

Suppose we have a crypto filesystem on a raid1 array  of 2 devices. What will
the kernel cache of fileystem data contain - encrypted data or not? Will is 
be 2 copies of the same data in the cache or not?

Is there any way to force kernel to cache the same file data only once, and
keep it unencrypted (in cache)?

Thanks in advance. 
-- 
 Best regards,
  -Vlad

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.4 and cryptofs on raid1 - what will be cached and how many times
  2003-03-02 10:56 2.4 and cryptofs on raid1 - what will be cached and how many times Vlad Harchev
@ 2003-03-03  9:38 ` Vlad Harchev
  2003-03-03 21:50   ` Neil Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Vlad Harchev @ 2003-03-03  9:38 UTC (permalink / raw)
  To: linux-kernel

On Sun, Mar 02, 2003 at 02:56:34PM +0400, Vlad Harchev wrote:
> Hello, 
> 
> Could you please answer the following question:
> 
> Suppose we have a crypto filesystem on a raid1 array  of 2 devices. What will
> the kernel cache of fileystem data contain - encrypted data or not? Will is 
> be 2 copies of the same data in the cache or not?

Sorry for confusion - of course I meant linux software raid here..
 
> Is there any way to force kernel to cache the same file data only once, and
> keep it unencrypted (in cache)?
> 

-- 
 Best regards,
  -Vlad

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.4 and cryptofs on raid1 - what will be cached and how many times
  2003-03-03  9:38 ` Vlad Harchev
@ 2003-03-03 21:50   ` Neil Brown
  2003-03-04  9:30     ` Vlad Harchev
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2003-03-03 21:50 UTC (permalink / raw)
  To: Vlad Harchev; +Cc: linux-kernel

On Monday March 3, hvv@hippo.ru wrote:
> On Sun, Mar 02, 2003 at 02:56:34PM +0400, Vlad Harchev wrote:
> > Hello, 
> > 
> > Could you please answer the following question:
> > 
> > Suppose we have a crypto filesystem on a raid1 array  of 2 devices. What will
> > the kernel cache of fileystem data contain - encrypted data or not? Will is 
> > be 2 copies of the same data in the cache or not?
> 
> Sorry for confusion - of course I meant linux software raid here..

With raid1 has no effect on caching.  Exactly the same data is cached
with raid1 as with as plain SCSI or IDE drive.

Raid5 is different.  It has an extra cache of some of the data that
has been written-to or read-from the devices.


>  
> > Is there any way to force kernel to cache the same file data only once, and
> > keep it unencrypted (in cache)?
> > 

I suspect that depends of the details of the implementation of you
"crypto filesystem".

NeilBrown

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.4 and cryptofs on raid1 - what will be cached and how many times
  2003-03-04  9:30     ` Vlad Harchev
@ 2003-03-04  9:20       ` Jörn Engel
  2003-03-04 11:31         ` Vlad Harchev
  0 siblings, 1 reply; 7+ messages in thread
From: Jörn Engel @ 2003-03-04  9:20 UTC (permalink / raw)
  To: Vlad Harchev; +Cc: Neil Brown, linux-kernel

On Tue, 4 March 2003 13:30:20 +0400, Vlad Harchev wrote:
> 
>  Sorry for confusion - I meant loopback-based crypto filesystem - e.g. loop-aes
> based (loop-aes.sourceforge.net) or CryptoAPI-based (www.kerneli.org) - both
> are loopback-based filesystem (one has to call losetup(8) to point out chipher,
> a password..)

Loopback with encryption is not the same as a crypto filesystem.
Loopback encryption works transparently with any (non-)crypto fs.

A potential attacker can use this to look for the ext2 superblock,
which gives him the same data both encrypted an unencrypted. A real
cryptofs would go through great pains to take such advantages away.

Jörn

-- 
Invincibility is in oneself, vulnerability is in the opponent.
-- Sun Tzu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.4 and cryptofs on raid1 - what will be cached and how many times
  2003-03-03 21:50   ` Neil Brown
@ 2003-03-04  9:30     ` Vlad Harchev
  2003-03-04  9:20       ` Jörn Engel
  0 siblings, 1 reply; 7+ messages in thread
From: Vlad Harchev @ 2003-03-04  9:30 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-kernel

On Tue, Mar 04, 2003 at 08:50:46AM +1100, Neil Brown wrote:
> On Monday March 3, hvv@hippo.ru wrote:
> > On Sun, Mar 02, 2003 at 02:56:34PM +0400, Vlad Harchev wrote:
> > > Hello, 
> > > 
> > > Could you please answer the following question:
> > > 
> > > Suppose we have a crypto filesystem on a raid1 array  of 2 devices. What will
> > > the kernel cache of fileystem data contain - encrypted data or not? Will is 
> > > be 2 copies of the same data in the cache or not?
> > 
> > Sorry for confusion - of course I meant linux software raid here..
> 
> With raid1 has no effect on caching.  Exactly the same data is cached
> with raid1 as with as plain SCSI or IDE drive.

 The question I asked is - will under the active usage there be exactly one
copy of a file's data, or there will be N (where N is number of disks in raid1
array) copies in the cache? I.e. how optimal caching is performed?
 
> Raid5 is different.  It has an extra cache of some of the data that
> has been written-to or read-from the devices.

 OK, thank you for pointing this.
 
> 
> >  
> > > Is there any way to force kernel to cache the same file data only once, and
> > > keep it unencrypted (in cache)?
> > > 
> 
> I suspect that depends of the details of the implementation of you
> "crypto filesystem".

 Sorry for confusion - I meant loopback-based crypto filesystem - e.g. loop-aes
based (loop-aes.sourceforge.net) or CryptoAPI-based (www.kerneli.org) - both
are loopback-based filesystem (one has to call losetup(8) to point out chipher,
a password..) I'm getting an impression that the kernel cache will contain
encrypted data in case loopback-based crypto filesystems are used just 
observing performance..

Thank you for the anwser!
-- 
 Best regards,
  -Vlad

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.4 and cryptofs on raid1 - what will be cached and how many times
  2003-03-04 11:31         ` Vlad Harchev
@ 2003-03-04 11:07           ` Bryan Andersen
  0 siblings, 0 replies; 7+ messages in thread
From: Bryan Andersen @ 2003-03-04 11:07 UTC (permalink / raw)
  To: Vlad Harchev; +Cc: J?rn Engel, Neil Brown, linux-kernel



Vlad Harchev wrote:

>>A potential attacker can use this to look for the ext2 superblock,
>>which gives him the same data both encrypted an unencrypted. A real
> 
>  
>  I've got an impression that in case of loopback with encryption the 
> superblock will also be encrypted. 
>  If one forgets known cleartext attacks, one can place the filesystem at
> some offset.

Yes it would be encrypted.  Unfortunately it is predictable data and as 
such it is much easier to crack.  Better set that offset at a location 
computed from the encryption key.

On a side note I find it interesting that many people sugest compressing 
a file before encrypting it.  Take a look at the first few bytes of 
every compressed file.  Unless your going to get rid of that header...

>>cryptofs would go through great pains to take such advantages away.

- Bryan





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: 2.4 and cryptofs on raid1 - what will be cached and how many times
  2003-03-04  9:20       ` Jörn Engel
@ 2003-03-04 11:31         ` Vlad Harchev
  2003-03-04 11:07           ` Bryan Andersen
  0 siblings, 1 reply; 7+ messages in thread
From: Vlad Harchev @ 2003-03-04 11:31 UTC (permalink / raw)
  To: J?rn Engel; +Cc: Neil Brown, linux-kernel

On Tue, Mar 04, 2003 at 10:20:31AM +0100, J?rn Engel wrote:
> On Tue, 4 March 2003 13:30:20 +0400, Vlad Harchev wrote:
> > 
> >  Sorry for confusion - I meant loopback-based crypto filesystem - e.g. loop-aes
> > based (loop-aes.sourceforge.net) or CryptoAPI-based (www.kerneli.org) - both
> > are loopback-based filesystem (one has to call losetup(8) to point out chipher,
> > a password..)
> 
> Loopback with encryption is not the same as a crypto filesystem.
> Loopback encryption works transparently with any (non-)crypto fs.

 Yes, you are right.
 
> A potential attacker can use this to look for the ext2 superblock,
> which gives him the same data both encrypted an unencrypted. A real
 
 I've got an impression that in case of loopback with encryption the 
superblock will also be encrypted. 
 If one forgets known cleartext attacks, one can place the filesystem at
some offset.

> cryptofs would go through great pains to take such advantages away.
> 
-- 
 Best regards,
  -Vlad

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-03-04 10:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 10:56 2.4 and cryptofs on raid1 - what will be cached and how many times Vlad Harchev
2003-03-03  9:38 ` Vlad Harchev
2003-03-03 21:50   ` Neil Brown
2003-03-04  9:30     ` Vlad Harchev
2003-03-04  9:20       ` Jörn Engel
2003-03-04 11:31         ` Vlad Harchev
2003-03-04 11:07           ` Bryan Andersen

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).