Commit 7785a9e4 authored by Damien Le Moal's avatar Damien Le Moal Committed by Mike Snitzer

dm crypt: Initialize crypto wait structures

Use the DECLARE_CRYPTO_WAIT() macro to properly initialize the crypto
wait structures declared on stack before their use with
crypto_wait_req().

Fixes: 39d13a1a ("dm crypt: reuse eboiv skcipher for IV generation")
Fixes: bbb16584 ("dm crypt: Implement Elephant diffuser for Bitlocker compatibility")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent c322ee93
...@@ -739,7 +739,7 @@ static int crypt_iv_eboiv_gen(struct crypt_config *cc, u8 *iv, ...@@ -739,7 +739,7 @@ static int crypt_iv_eboiv_gen(struct crypt_config *cc, u8 *iv,
u8 buf[MAX_CIPHER_BLOCKSIZE] __aligned(__alignof__(__le64)); u8 buf[MAX_CIPHER_BLOCKSIZE] __aligned(__alignof__(__le64));
struct skcipher_request *req; struct skcipher_request *req;
struct scatterlist src, dst; struct scatterlist src, dst;
struct crypto_wait wait; DECLARE_CRYPTO_WAIT(wait);
int err; int err;
req = skcipher_request_alloc(any_tfm(cc), GFP_NOIO); req = skcipher_request_alloc(any_tfm(cc), GFP_NOIO);
...@@ -936,7 +936,7 @@ static int crypt_iv_elephant(struct crypt_config *cc, struct dm_crypt_request *d ...@@ -936,7 +936,7 @@ static int crypt_iv_elephant(struct crypt_config *cc, struct dm_crypt_request *d
u8 *es, *ks, *data, *data2, *data_offset; u8 *es, *ks, *data, *data2, *data_offset;
struct skcipher_request *req; struct skcipher_request *req;
struct scatterlist *sg, *sg2, src, dst; struct scatterlist *sg, *sg2, src, dst;
struct crypto_wait wait; DECLARE_CRYPTO_WAIT(wait);
int i, r; int i, r;
req = skcipher_request_alloc(elephant->tfm, GFP_NOIO); req = skcipher_request_alloc(elephant->tfm, GFP_NOIO);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment