linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] fscrypt changes for btrfs encryption
@ 2022-07-24  0:52 Sweet Tea Dorminy
  2022-07-24  0:52 ` [PATCH RFC 1/4] fscrypt: expose fscrypt_nokey_name Sweet Tea Dorminy
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Sweet Tea Dorminy @ 2022-07-24  0:52 UTC (permalink / raw)
  To: Theodore Y . Ts'o ,
	Jaegeuk Kim, Eric Biggers, linux-fscrypt, linux-kernel,
	linux-btrfs, osandov, kernel-team
  Cc: Sweet Tea Dorminy

This is the fscrypt section of my draft patch series [1] to add
encryption support to btrfs.

Last October, Omar Sandoval sent out a design proposal for using fscrypt
with btrfs [2]. To tersely summarize the challenges laid out in the
document, btrfs supports sharing the same physical storage between
multiple files (reflinks); moving the physical location of file data
without access to the file inodes; and creating writable snapshots of
some directories (subvolumes). To allow encryption to coexist with these
features, the proposal was for btrfs to create and preserve an IV per
data block, no matter its physical location or owning inode(s), and for
btrfs to allow partially-encrypted writable snapshots of unencrypted
subvolumes.

To deal with these issues, a few changes to fscrypt are proposed:
- To enable snapshotting and then encrypting new writes to that
  subvolume, a flag to allow partially encrypted directories;
- To allow filesystems to supply an IV in cases where the logical block
  number and owning inode for data may change, a new policy and
  interface to convey IVs from filesystem to fscrypt.

Comments, especially on the new policy and interface, appreciated!

[1] https://lore.kernel.org/linux-btrfs/cover.1658623319.git.sweettea-kernel@dorminy.me
[2] https://lore.kernel.org/linux-btrfs/YXGyq+buM79A1S0L@relinquished.localdomain/

Omar Sandoval (3):
  fscrypt: expose fscrypt_nokey_name
  fscrypt: add flag allowing partially-encrypted directories
  fscrypt: add fscrypt_have_same_policy() to check inode's compatibility

Sweet Tea Dorminy (1):
  fscrypt: Add new encryption policy for btrfs.

 fs/crypto/crypto.c           | 28 +++++++++++++++--
 fs/crypto/fname.c            | 56 ++++++++++-----------------------
 fs/crypto/fscrypt_private.h  |  4 +--
 fs/crypto/inline_crypt.c     | 20 ++++++++----
 fs/crypto/keysetup.c         |  5 +++
 fs/crypto/policy.c           | 42 ++++++++++++++++++++++++-
 include/linux/fscrypt.h      | 61 +++++++++++++++++++++++++++++++++++-
 include/uapi/linux/fscrypt.h |  1 +
 8 files changed, 166 insertions(+), 51 deletions(-)

-- 
2.35.1


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

end of thread, other threads:[~2022-07-26 19:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-24  0:52 [PATCH RFC 0/4] fscrypt changes for btrfs encryption Sweet Tea Dorminy
2022-07-24  0:52 ` [PATCH RFC 1/4] fscrypt: expose fscrypt_nokey_name Sweet Tea Dorminy
2022-07-24  0:52 ` [PATCH RFC 2/4] fscrypt: add flag allowing partially-encrypted directories Sweet Tea Dorminy
2022-07-25 19:49   ` Eric Biggers
2022-07-26  2:13     ` Sweet Tea Dorminy
2022-07-24  0:52 ` [PATCH RFC 3/4] fscrypt: add fscrypt_have_same_policy() to check inode's compatibility Sweet Tea Dorminy
2022-07-24  0:52 ` [PATCH RFC 4/4] fscrypt: Add new encryption policy for btrfs Sweet Tea Dorminy
2022-07-25 23:32   ` Eric Biggers
2022-07-26  2:16     ` Sweet Tea Dorminy
2022-07-26 17:45       ` David Sterba
2022-07-26 19:29       ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).