linux/fs/crypto
Linus Torvalds 1d7443e4dc fscrypt updates for 7.3
The main change this cycle is a significant simplification that's been
 overdue for a while now: standardizing on a single file contents
 encryption implementation in ext4 and f2fs, instead of having two.
 
 Specifically, the original filesystem-layer file contents encryption
 implementation is removed, and the blk-crypto implementation is now
 used unconditionally. blk-crypto delegates either to inline crypto
 hardware or to the CPU via blk-crypto-fallback. The latter is
 functionally equivalent to the original filesystem-layer code.
 
 The blk-crypto implementation already existed, but previously it was
 used only when the filesystem was mounted with "-o inlinecrypt". Now,
 "-o inlinecrypt" just selects whether inline crypto hardware is used.
 
 To allow maintaining that user control over hardware use, the
 blk-crypto API is extended with a new flag BLK_CRYPTO_CFG_ALLOW_HW.
 
 Overall, this removes quite a bit of redundant code from ext4, f2fs,
 and fs/crypto/. It should make things easier for ongoing filesystem
 efforts such as iomap support, large folios, and btrfs encryption.
 (btrfs had already been planning to use blk-crypto exclusively.)
 
 There are two small behavior changes of note:
 
 - Direct I/O now works on encrypted files even without
   "-o inlinecrypt", rather than falling back to buffered I/O. This is
   effectively a bugfix, though I'll continue to keep an eye out for
   any user that may have been depending on the buffered I/O fallback.
 
 - IV_INO_LBLK_32 policies are no longer supported in certain cases
   that didn't make sense and have no known uses.
 
 This has been in linux-next since July 22 with no reported issues.
 All encryption xfstests pass on ext4 and f2fs. As usual I've also been
 using it on a system with an fscrypt-encrypted home directory. Of
 course, the blk-crypto code paths also aren't new and were already
 being used on many systems via the inlinecrypt mount option.
 
 In addition to the main change described above, there are a few other
 cleanups such as using lock guards for mutexes, improving
 documentation, and removing a workaround for outdated gcc versions.
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQSacvsUNc7UX4ntmEPzXCl4vpKOKwUCaoDumhQcZWJpZ2dlcnNA
 a2VybmVsLm9yZwAKCRDzXCl4vpKOKwk1AP9gAHdxAK2tr+Wpklkos/qTMR3a7h2I
 xLmgwhLHmHoHTgD/cD+0eMoK4RIVVGS/73Bf7oF2qY5jOyfi1aGh4ERQ0AA=
 =0+o6
 -----END PGP SIGNATURE-----

Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux

Pull fscrypt updates from Eric Biggers:
 "The main change this cycle is a significant simplification that's been
  overdue for a while now: standardizing on a single file contents
  encryption implementation in ext4 and f2fs, instead of having two.

  Specifically, the original filesystem-layer file contents encryption
  implementation is removed, and the blk-crypto implementation is now
  used unconditionally. blk-crypto delegates either to inline crypto
  hardware or to the CPU via blk-crypto-fallback. The latter is
  functionally equivalent to the original filesystem-layer code.

  The blk-crypto implementation already existed, but previously it was
  used only when the filesystem was mounted with "-o inlinecrypt". Now,
  "-o inlinecrypt" just selects whether inline crypto hardware is used.

  To allow maintaining that user control over hardware use, the
  blk-crypto API is extended with a new flag BLK_CRYPTO_CFG_ALLOW_HW.

  Overall, this removes quite a bit of redundant code from ext4, f2fs,
  and fs/crypto/. It should make things easier for ongoing filesystem
  efforts such as iomap support, large folios, and btrfs encryption
  (btrfs had already been planning to use blk-crypto exclusively.)

  There are two small behavior changes of note:

   - Direct I/O now works on encrypted files even without "-o inlinecrypt",
     rather than falling back to buffered I/O. This is effectively a
     bugfix, though I'll continue to keep an eye out for any user that
     may have been depending on the buffered I/O fallback.

   - IV_INO_LBLK_32 policies are no longer supported in certain cases
     that didn't make sense and have no known uses.

  This has been in linux-next since July 22 with no reported issues. All
  encryption xfstests pass on ext4 and f2fs. As usual I've also been
  using it on a system with an fscrypt-encrypted home directory. Of
  course, the blk-crypto code paths also aren't new and were already
  being used on many systems via the inlinecrypt mount option.

  In addition to the main change described above, there are a few other
  cleanups such as using lock guards for mutexes, improving
  documentation, and removing a workaround for outdated gcc versions"

* tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux: (29 commits)
  blk-crypto: Update docs for blk-crypto-fallback motivation
  blk-crypto: Remove unused function blk_crypto_config_supported()
  fscrypt: Update docs for data path
  fscrypt: Remove unused function fscrypt_finalize_bounce_page()
  f2fs: Update outdated comment in f2fs_write_begin()
  fs: Update outdated comment for SB_INLINECRYPT
  fscrypt: Update encryption policy version docs
  fscrypt: Replace some variable-size memsets with fixed-size
  fscrypt: Add safety checks to non-block-based en/decryption
  fscrypt: Merge bio.c and inline_crypt.c into block.c
  fscrypt: Remove unused functions and workqueue
  fscrypt: Remove fs-layer zeroout code
  fscrypt: Remove fscrypt_dio_supported()
  fscrypt: Replace calls to fscrypt_inode_uses_inline_crypto()
  fs/buffer: Remove fs-layer decryption code
  f2fs: Remove fs-layer file contents en/decryption code
  ext4: Further de-generalize the bio postprocessing code
  ext4: Make ext4_bio_write_folio() return void
  ext4: Remove fs-layer file contents en/decryption code
  Documentation: fscrypt: Update docs for inlinecrypt
  ...
2026-08-17 19:04:16 -07:00
..
block.c fscrypt: Merge bio.c and inline_crypt.c into block.c 2026-07-20 10:39:26 -07:00
crypto.c fscrypt: Replace some variable-size memsets with fixed-size 2026-07-20 10:39:26 -07:00
fname.c fs: add helpers name_is_dot{,dot,_dotdot} 2026-01-29 10:06:59 +01:00
fscrypt_private.h fscrypt: Merge bio.c and inline_crypt.c into block.c 2026-07-20 10:39:26 -07:00
hkdf.c fscrypt: use HMAC-SHA512 library for HKDF 2025-09-05 21:01:51 -07:00
hooks.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
Kconfig fscrypt: Always use blk-crypto for contents on block-based filesystems 2026-07-20 10:39:25 -07:00
keyring.c fscrypt: Simplify handling of errors during initcall 2026-07-20 10:39:25 -07:00
keysetup_v1.c fscrypt: Replace some variable-size memsets with fixed-size 2026-07-20 10:39:26 -07:00
keysetup.c fscrypt: Replace some variable-size memsets with fixed-size 2026-07-20 10:39:26 -07:00
Makefile fscrypt: Merge bio.c and inline_crypt.c into block.c 2026-07-20 10:39:26 -07:00
policy.c fscrypt updates for 7.3 2026-08-17 19:04:16 -07:00