]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dm crypt: Initialize crypto wait structures
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 31 Aug 2020 05:55:55 +0000 (14:55 +0900)
committerMike Snitzer <snitzer@redhat.com>
Tue, 1 Sep 2020 20:41:57 +0000 (16:41 -0400)
Use the DECLARE_CRYPTO_WAIT() macro to properly initialize the crypto
wait structures declared on stack before their use with
crypto_wait_req().

Fixes: d28b2eb34f34 ("dm crypt: reuse eboiv skcipher for IV generation")
Fixes: db96758f1b79 ("dm crypt: Implement Elephant diffuser for Bitlocker compatibility")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c

index 238cd80826a69584c7242b084f4a1e8b97ef3c9a..380386c36921f799a236f8d2701f3314f8b8e4fc 100644 (file)
@@ -739,7 +739,7 @@ static int crypt_iv_eboiv_gen(struct crypt_config *cc, u8 *iv,
        u8 buf[MAX_CIPHER_BLOCKSIZE] __aligned(__alignof__(__le64));
        struct skcipher_request *req;
        struct scatterlist src, dst;
-       struct crypto_wait wait;
+       DECLARE_CRYPTO_WAIT(wait);
        int err;
 
        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
        u8 *es, *ks, *data, *data2, *data_offset;
        struct skcipher_request *req;
        struct scatterlist *sg, *sg2, src, dst;
-       struct crypto_wait wait;
+       DECLARE_CRYPTO_WAIT(wait);
        int i, r;
 
        req = skcipher_request_alloc(elephant->tfm, GFP_NOIO);