blk-crypto: dynamically allocate fallback profile
authorSweet Tea Dorminy <sweettea-kernel@dorminy.me>
Thu, 17 Aug 2023 14:15:56 +0000 (10:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:52:39 +0000 (17:52 +0200)
commit8ad3bfdd227e0f644e0c528c9d80d108a74c0f0f
treec5176fc08056957553ae47e17d7eb8b927e986f1
parent65bcb07b1262f995301d5343834c23ebc1312f96
blk-crypto: dynamically allocate fallback profile

commit c984ff1423ae9f70b1f28ce811856db0d9c99021 upstream.

blk_crypto_profile_init() calls lockdep_register_key(), which warns and
does not register if the provided memory is a static object.
blk-crypto-fallback currently has a static blk_crypto_profile and calls
blk_crypto_profile_init() thereupon, resulting in the warning and
failure to register.

Fortunately it is simple enough to use a dynamically allocated profile
and make lockdep function correctly.

Fixes: 2fb48d88e77f ("blk-crypto: use dynamic lock class for blk_crypto_profile::lock")
Cc: stable@vger.kernel.org
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20230817141615.15387-1-sweettea-kernel@dorminy.me
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-crypto-fallback.c