I'll try to provide some useful backstory:
When we released Chromium OS in 2009, we used[1] per-user sparse files
on dm-crypt. dm-thin didn't exist, discard/trim weren't safe to be
used anywhere, etc. Instead we used a trick on sign-out where we
resize2fs the user volume to the smallest size and then truncated the
sparse file - then we forgot the dm-crypt key. On sign-in, we'd
always sparsely resize the filesystem back to the full sparse-size.
This worked (shock!), but the challenge was that it meant that a
particularly long lived session could introduce a lot of fs churn.
The churn would make resize2fs slow which in turn made sign-out slow.
This meant reboots from a signed-in session also got slow. On the
whole, it seemed unsustainable if we wanted the experience to be
snappy and safe, and not just safe.
Around that time, ecryptfs had been seeing field testing from
Canonical, and I'd be using it for some other things. It seemed like
the right trade off for the time -- deal with VFS complexity, bad
locking decisions, limited ability to take advantage of the buffer
caches, etc in order to get speedy and reliable sign-in/sign-out. We
then took advantage of passthrough files for passing through
directories that have safely-removable data: Cache, Downloads, etc.
(
f...@chromium.org did the migration and legwork to make ecryptfs and
our current tpm-brokered key unwrapped exist.)
Unfortunately, I've never been particularly happy with ecryptfs
itself, and I don't think it will get leaps and bounds better any time
soon. I'd like to move all user data back to per-user dm-crypt
volumes. However, ext4->dm-crypt->loop->ext4->stateful is quite a few
layers. Kees has forced it into working reliably for
mount-encrypted.c with discard support, but doing it in one place is
easier to manage that doing it for each user. We're not sure if
complexity in the vfs is worse than complexity across the various
system interfaces. We keep going back and forth, but the ideal
solution is to use dm-thin. It's the elegant solution that avoids
having two filesystems stacked and passing around discards. I'm
hoping it we can move to it as it matures and we figure out a good
migration strategy :)
As to the "Protecting Cached User Data" doc, it is pretty much
up-to-date. Not too much has changed. However, I didn't realize that
revisions were not publicly accessible. Here is the published design
document for the prior version:
https://docs.google.com/document/d/13Epf_DOW8SBkfNhMBP_c8UABmz-l1wyIQ-bb72yN-gc/pub
hth!
will
1 -
http://git.chromium.org/gitweb/?p=chromiumos/platform/cryptohome.git;a=blob;f=lib/cryptohome;h=2e62cff6c17f76c6cd7c81a94cbd3fcaefdb6845;hb=c9845b92f049801da53d57eaf9bd549f5eb0c201
History is truncated from the move to git. This originally lived in svn.