public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* Checksum and transform layering
@ 2008-11-06  6:34 Gregory Maxwell
  2008-11-06 12:15 ` Claudio Martins
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gregory Maxwell @ 2008-11-06  6:34 UTC (permalink / raw)
  To: linux-btrfs

I noticed in the compression support that the checksum is over the
uncompressed data.

While this has the advantages that the checksum does not have to be
changed as transformations are changed and the system might catch
errors in the compression layer, this design decision will be
problematic if/when encryption is supported:  Plaintext checksums
would leak substantial amounts of information about the content of
files.  The system could be switched to a keyed cryptographic hash,
but then you will have made the "checksum" part of the file system
intimately tied to the cryptographic part (including having to deal
with key management, not being able to check blocks with keys that are
currently unavailable which would break automated scrubbing), and a
potential source of security problems. I think there is currently
enough space to store per-block a 64 bit checksum for integrity, a
64bit nonce for uniqueness, and a 128bit cryptographic hash for
authentication.

A minor additional point, by applying the checksum before other
transformations you lose the straightforward algebraic relationship
with the disk bits and check data. One advantage checksums and RS
codes have over cryptographic hashes is that advanced recovery tools
could be created which utilize all available data (multiple mirror
blocks, raid data, known corrupted sectors from the disk, and multiple
check) to provide maximum likelihood decodes, for cases where
known-perfect decoding is not possible, and the data can't be
otherwise replaced. I don't know if anyone will bother building such
tools, but maybe someone cares.

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

end of thread, other threads:[~2008-12-09  0:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-06  6:34 Checksum and transform layering Gregory Maxwell
2008-11-06 12:15 ` Claudio Martins
2008-11-06 17:49   ` Tracy Reed
     [not found] ` <1225982445.15281.15.camel@think.oraclecorp.com>
2008-11-06 14:58   ` Gregory Maxwell
2008-11-06 15:27     ` Xavier Nicollet
2008-11-06 15:43       ` Gregory Maxwell
2008-12-09  0:23   ` Chris Mason
2008-11-06 16:31 ` Florian Weimer
2008-11-06 16:42   ` Gregory Maxwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox