CHROMIUM: Add support for ext4 crypto.

Add a keyring, named dircrypt, to the session keyring to
store keys used for decoding directories encrypted with ext4 crypto and
potientially other filesystems like f2fs.

All other processes will inherit that keyring through the session keyring,
therefore they will be allowed to decode directories as long as they have
access rights.

Adding a keyring in init is similar to the Android implementation.

BUG=chromium:347322
TEST=Check the keyring is installed in 3.14 and 3.18:
For any user (chronos/root), "keyctl show" returns the dircrypt keyring.
For instance:
Session Keyring
  12378248 --alswrv      0     0  keyring: _ses
   733485135 --alswrv      0     0   \_ keyring: dircrypt
Check cryptohomed is able to mount/unmount ext4 crypto home directory.

Check that when ext4 crypto is not supported, (3.10), the keyring is not
created.

Reviewed-on: https://chromium-review.googlesource.com/331340
Change-Id: I221cc0584dc1888eeb40efba6a1b19edbd72b7f3
3 files changed