Skip to content

fscrypt: add extent encryption

Sweet Tea Dorminy linux-btrfs linux-fscrypt 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest16 patches 17 repliesIn review
  2. v214 patches 8 repliesSuperseded
  3. v112 patches 11 repliesSuperseded

Changes in v3 from the cover letter

- Added four additional changes:
- soft-deleting keys that extent infos might later need to use, so the behavior of an open file after key removal matches inode-based fscrypt.
- a set of changes to allow asynchronous info freeing for extents, necessary due to locking constraints in btrfs.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16fscrypt: factor helper for locking master keyfs/crypto/keysetup.c+14 -61 reply
2/16fscrypt: factor getting info for a specific blockfs/crypto/crypto.c fs/crypto/fscrypt_private.h fs/crypto/inline_crypt.c+37 -50 replies
3/16fscrypt: adjust effective lblks based on extentsfs/crypto/crypto.c fs/crypto/inline_crypt.c+16 -70 replies
4/16fscrypt: add a super_block pointer to fscrypt_infofs/crypto/fscrypt_private.h fs/crypto/inline_crypt.c fs/crypto/keysetup.c +1 more+13 -100 replies
5/16fscrypt: setup leaf inodes for extent encryptionfs/crypto/fscrypt_private.h fs/crypto/keysetup.c+63 -140 replies
6/16fscrypt: allow infos to be owned by extentsfs/crypto/fscrypt_private.h fs/crypto/keysetup.c+40 -110 replies
7/16fscrypt: use an optional ino equivalent for per-extent infosfs/crypto/fscrypt_private.h fs/crypto/keyring.c fs/crypto/keysetup.c +1 more+34 -71 reply
8/16fscrypt: move function call warning of busy inodesfs/crypto/keyring.c+12 -130 replies
9/16fscrypt: revamp key removal for extent encryptionfs/crypto/fscrypt_private.h fs/crypto/keyring.c fs/crypto/keysetup.c+95 -161 reply
10/16fscrypt: add creation/usage/freeing of per-extent infosfs/crypto/crypto.c fs/crypto/fscrypt_private.h fs/crypto/inline_crypt.c +2 more+141 -330 replies
11/16fscrypt: allow load/save of extent contextsfs/crypto/keysetup.c fs/crypto/policy.c include/linux/fscrypt.h+86 -00 replies
12/16fscrypt: save session key credentials for extent infosfs/crypto/fscrypt_private.h fs/crypto/keysetup.c fs/crypto/keysetup_v1.c+23 -01 reply
13/16fscrypt: allow multiple extents to reference one infofs/crypto/fscrypt_private.h fs/crypto/keysetup.c include/linux/fscrypt.h+24 -12 replies
14/16fscrypt: cache list of inlinecrypt devicesfs/crypto/fscrypt_private.h fs/crypto/inline_crypt.c fs/crypto/keysetup.c+21 -141 reply
15/16fscrypt: allow asynchronous info freeingfs/crypto/fscrypt_private.h fs/crypto/keyring.c fs/crypto/keysetup.c +1 more+40 -121 reply
16/16fscrypt: update documentation for per-extent keysDocumentation/filesystems/fscrypt.rst+37 -60 replies

Reviews trailers per patch

None of the 16 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJosef Bacik
SeriesR-b
1/16
2/16
3/16
4/16
5/16
6/16
7/16
8/16
9/16
10/16
11/16
12/16
13/16
14/16
15/16
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/16] fscrypt: add extent encryption

This changeset adds extent-based data encryption to fscrypt. Some filesystems need to encrypt data based on extents, rather than on inodes, due to features incompatible with inode-based encryption. For instance, btrfs can have multiple inodes referencing a single block of data, and moves logical data blocks to different physical locations on disk in the background.

As per discussion last year in [1] and later in [2], we would like to allow the use of fscrypt with btrfs, with authenticated encryption. This is the first step of that work, adding extent-based encryption to fscrypt; authenticated encryption is the next step. Extent-based encryption should be usable by other filesystems which wish to support snapshotting or background data rearrangement also, but btrfs is the first user.

This changeset requires extent encryption to use inlinecrypt, as discussed previously.

This applies atop [3], which itself is based on kdave/misc-next. It passes encryption fstests with suitable changes to btrfs-progs.

Changelog:
v3:
- Added four additional changes:
- soft-deleting keys that extent infos might later need to use, so the behavior of an open file after key removal matches inode-based fscrypt.
- a set of changes to allow asynchronous info freeing for extents, necessary due to locking constraints in btrfs.

v2:
- https://lore.kernel.org/linux-fscrypt/[email protected]/T/#t

[1] https://docs.google.com/document/d/1janjxewlewtVPqctkWOjSa7OhCgB8Gdx7iDaCDQQNZA/edit?usp=sharing
[2] https://lore.kernel.org/linux-fscrypt/[email protected]/T/#t
[3] https://lore.kernel.org/linux-fscrypt/[email protected]/

Sweet Tea Dorminy (16):
fscrypt: factor helper for locking master key
fscrypt: factor getting info for a specific block
fscrypt: adjust effective lblks based on extents
fscrypt: add a super_block pointer to fscrypt_info
fscrypt: setup leaf inodes for extent encryption
fscrypt: allow infos to be owned by extents
fscrypt: use an optional ino equivalent for per-extent infos
fscrypt: move function call warning of busy inodes
fscrypt: revamp key removal for extent encryption
fscrypt: add creation/usage/freeing of per-extent infos
fscrypt: allow load/save of extent contexts
fscrypt: save session key credentials for extent infos
fscrypt: allow multiple extents to reference one info
fscrypt: cache list of inlinecrypt devices
fscrypt: allow asynchronous info freeing
fscrypt: update documentation for per-extent keys

 Documentation/filesystems/fscrypt.rst |  43 +++-
 fs/crypto/crypto.c                    |   6 +-
 fs/crypto/fscrypt_private.h           | 158 +++++++++++-
 fs/crypto/inline_crypt.c              |  49 ++--
 fs/crypto/keyring.c                   |  78 +++---
 fs/crypto/keysetup.c                  | 336 ++++++++++++++++++++++----
 fs/crypto/keysetup_v1.c               |  10 +-
 fs/crypto/policy.c                    |  20 ++
 include/linux/fscrypt.h               |  67 +++++
 9 files changed, 654 insertions(+), 113 deletions(-)

base-commit: 54d2161835d828a9663f548f61d1d9c3d3482122
prerequisite-patch-id: 2f1424d04bb5a76abf0ecf2c9cd8426d300078ae
prerequisite-patch-id: ab342a72cf967dadfb8bec1320c5906fd3c6800f
prerequisite-patch-id: ced2a9dab36539f55c14cd74a28950087c475ff2
prerequisite-patch-id: d4f1a64c994c2fa0d2d4cab83f9ddff52f0622e9
prerequisite-patch-id: 1af0fc98277159b31c26bc5751663efc0d322d75
prerequisite-patch-id: 3b21b62208587486cf9b31618f7c3bc875362f1a
prerequisite-patch-id: c43d693f5b7c498a876d9ffcfc49c11a8ca93d80
prerequisite-patch-id: f120bde1cf47fbef1d9f8fd09cdcccc1408c3ff4
prerequisite-patch-id: c6a1f087d4a67b928b9c6af04e00310bfa74ace1

Signature · 1 line
2.41.0