mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 02:46:06 +00:00
dm crypt: Fix reqsize in crypt_iv_eboiv_gen
A skcipher_request object is made up of struct skcipher_request followed by a variable-sized trailer. The allocation of the skcipher_request and IV in crypt_iv_eboiv_gen is missing the memory for struct skcipher_request. Fix it by adding it to reqsize. Fixes: e3023094dffb ("dm crypt: Avoid using MAX_CIPHER_BLOCKSIZE") Cc: <stable@vger.kernel.org> #6.5+ Reported-by: Tatu Heikkilä <tatu.heikkila@gmail.com> Reviewed-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
21155620fb
commit
152d0bcdf1
@ -753,7 +753,8 @@ static int crypt_iv_eboiv_gen(struct crypt_config *cc, u8 *iv,
|
||||
int err;
|
||||
u8 *buf;
|
||||
|
||||
reqsize = ALIGN(crypto_skcipher_reqsize(tfm), __alignof__(__le64));
|
||||
reqsize = sizeof(*req) + crypto_skcipher_reqsize(tfm);
|
||||
reqsize = ALIGN(reqsize, __alignof__(__le64));
|
||||
|
||||
req = kmalloc(reqsize + cc->iv_size, GFP_NOIO);
|
||||
if (!req)
|
||||
|
Loading…
x
Reference in New Issue
Block a user