]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
Metadata support for v2 encryption policies
authorEric Biggers <ebiggers@google.com>
Mon, 16 Dec 2019 03:31:39 +0000 (19:31 -0800)
committerEric Biggers <ebiggers@google.com>
Sun, 5 Jan 2020 18:02:13 +0000 (10:02 -0800)
commit2b25de6d445faefc28629603dd754aec9f744e60
treec2e4dd53a2ed370be5b0699ede59538d508d347d
parentd0ac36dcea341ff000aca983dd80e7bef9fc30ec
Metadata support for v2 encryption policies

Linux v5.4 and later supports v2 encryption policies.  These have
several advantages over v1 encryption policies:

- Their encryption keys can be added/removed to/from the filesystem by
  non-root users, thus gaining the benefits of the filesystem keyring
  while also retaining support for non-root use.

- They use a more standard, secure, and flexible key derivation
  function.  Because of this, some future kernel-level fscrypt features
  will be implemented for v2 policies only.

- They prevent a denial-of-service attack where a user could associate
  the wrong key with another user's encrypted files.

Prepare the fscrypt tool to support v2 encryption policies by:

- Adding a policy_version field to the EncryptionOptions, i.e. to the
  config file and to the policy metadata files.

- Using the kernel-specified algorithm to compute the key descriptor for
  v2 policies.

- Handling setting and getting v2 policies.

Actually adding/removing the keys for v2 policies to/from the kernel is
left for the next patch.
13 files changed:
README.md
actions/config.go
actions/policy.go
actions/protector.go
crypto/crypto.go
crypto/crypto_test.go
metadata/checks.go
metadata/config_test.go
metadata/constants.go
metadata/metadata.pb.go
metadata/metadata.proto
metadata/policy.go
metadata/policy_test.go