diff options
author | 2022-09-01 12:32:07 -0700 | |
---|---|---|
committer | 2022-09-21 20:33:06 -0700 | |
commit | 22e9947a4b2ba255888541bd0111cf00b9b16586 (patch) | |
tree | 3eeb3e78d55ade9dd42dcc2900c25c9329f09f0c /fs/crypto/keyring.c | |
parent | fscrypt: stop using keyrings subsystem for fscrypt_master_key (diff) | |
download | linux-22e9947a4b2ba255888541bd0111cf00b9b16586.tar.gz linux-22e9947a4b2ba255888541bd0111cf00b9b16586.tar.bz2 linux-22e9947a4b2ba255888541bd0111cf00b9b16586.zip |
fscrypt: stop holding extra request_queue references
Now that the fscrypt_master_key lifetime has been reworked to not be
subject to the quirks of the keyrings subsystem, blk_crypto_evict_key()
no longer gets called after the filesystem has already been unmounted.
Therefore, there is no longer any need to hold extra references to the
filesystem's request_queue(s). (And these references didn't always do
their intended job anyway, as pinning a request_queue doesn't
necessarily pin the corresponding blk_crypto_profile.)
Stop taking these extra references. Instead, just pass the super_block
to fscrypt_destroy_inline_crypt_key(), and use it to get the list of
block devices the key needs to be evicted from.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20220901193208.138056-3-ebiggers@kernel.org
Diffstat (limited to 'fs/crypto/keyring.c')
-rw-r--r-- | fs/crypto/keyring.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/crypto/keyring.c b/fs/crypto/keyring.c index 9b98d6a576e6..1cca09aa43f8 100644 --- a/fs/crypto/keyring.c +++ b/fs/crypto/keyring.c @@ -105,9 +105,12 @@ void fscrypt_put_master_key_activeref(struct fscrypt_master_key *mk) WARN_ON(!list_empty(&mk->mk_decrypted_inodes)); for (i = 0; i <= FSCRYPT_MODE_MAX; i++) { - fscrypt_destroy_prepared_key(&mk->mk_direct_keys[i]); - fscrypt_destroy_prepared_key(&mk->mk_iv_ino_lblk_64_keys[i]); - fscrypt_destroy_prepared_key(&mk->mk_iv_ino_lblk_32_keys[i]); + fscrypt_destroy_prepared_key( + sb, &mk->mk_direct_keys[i]); + fscrypt_destroy_prepared_key( + sb, &mk->mk_iv_ino_lblk_64_keys[i]); + fscrypt_destroy_prepared_key( + sb, &mk->mk_iv_ino_lblk_32_keys[i]); } memzero_explicit(&mk->mk_ino_hash_key, sizeof(mk->mk_ino_hash_key)); |