]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
fscrypt: Allow modular crypto algorithms
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Dec 2019 02:47:00 +0000 (10:47 +0800)
committerEric Biggers <ebiggers@google.com>
Tue, 31 Dec 2019 16:33:51 +0000 (10:33 -0600)
The commit 643fa9612bf1 ("fscrypt: remove filesystem specific
build config option") removed modular support for fs/crypto.  This
causes the Crypto API to be built-in whenever fscrypt is enabled.
This makes it very difficult for me to test modular builds of
the Crypto API without disabling fscrypt which is a pain.

As fscrypt is still evolving and it's developing new ties with the
fs layer, it's hard to build it as a module for now.

However, the actual algorithms are not required until a filesystem
is mounted.  Therefore we can allow them to be built as modules.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://lore.kernel.org/r/20191227024700.7vrzuux32uyfdgum@gondor.apana.org.au
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/Kconfig
fs/ext4/Kconfig
fs/f2fs/Kconfig
fs/ubifs/Kconfig

index ff5a1746cbae4cc2f9fa26c30b6e85fb7f56da28..02df95b44331d515605d429f06a7746018bcc43d 100644 (file)
@@ -2,13 +2,8 @@
 config FS_ENCRYPTION
        bool "FS Encryption (Per-file encryption)"
        select CRYPTO
-       select CRYPTO_AES
-       select CRYPTO_CBC
-       select CRYPTO_ECB
-       select CRYPTO_XTS
-       select CRYPTO_CTS
-       select CRYPTO_SHA512
-       select CRYPTO_HMAC
+       select CRYPTO_HASH
+       select CRYPTO_SKCIPHER
        select KEYS
        help
          Enable encryption of files and directories.  This
@@ -16,3 +11,15 @@ config FS_ENCRYPTION
          efficient since it avoids caching the encrypted and
          decrypted pages in the page cache.  Currently Ext4,
          F2FS and UBIFS make use of this feature.
+
+# Filesystems supporting encryption must select this if FS_ENCRYPTION.  This
+# allows the algorithms to be built as modules when all the filesystems are.
+config FS_ENCRYPTION_ALGS
+       tristate
+       select CRYPTO_AES
+       select CRYPTO_CBC
+       select CRYPTO_CTS
+       select CRYPTO_ECB
+       select CRYPTO_HMAC
+       select CRYPTO_SHA512
+       select CRYPTO_XTS
index ef42ab040905731d1d574446c38d23d0fd5e6b6f..db9bfa08d3e088c757a0cb68580f67dc73b15b37 100644 (file)
@@ -39,6 +39,7 @@ config EXT4_FS
        select CRYPTO
        select CRYPTO_CRC32C
        select FS_IOMAP
+       select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
        help
          This is the next generation of the ext3 filesystem.
 
index 652fd2e2b23d4b7939f6fe94315b0c829ef5a63a..599fb9194c6ae2d0b08209fff9ef44a367cf5b84 100644 (file)
@@ -6,6 +6,7 @@ config F2FS_FS
        select CRYPTO
        select CRYPTO_CRC32
        select F2FS_FS_XATTR if FS_ENCRYPTION
+       select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
        help
          F2FS is based on Log-structured File System (LFS), which supports
          versatile "flash-friendly" features. The design has been focused on
index 69932bcfa92081c1f6826216dcc05b663437a6bb..45d3d207fb99266d1f6fff305a965cf889a5fa66 100644 (file)
@@ -12,6 +12,7 @@ config UBIFS_FS
        select CRYPTO_ZSTD if UBIFS_FS_ZSTD
        select CRYPTO_HASH_INFO
        select UBIFS_FS_XATTR if FS_ENCRYPTION
+       select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
        depends on MTD_UBI
        help
          UBIFS is a file system for flash devices which works on top of UBI.