crypto: lskcipher - Copy IV in lskcipher glue code always
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 21 Feb 2024 09:07:44 +0000 (17:07 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 24 Feb 2024 00:37:24 +0000 (08:37 +0800)
commit7cfc2ab3f0259212ecd130937893cb1d5c25ecc9
tree2f4f49476ae43f839b80919ed34f4e34b53a1403
parentc0ec2a712daf133d9996a8a1b7ee2d4996080363
crypto: lskcipher - Copy IV in lskcipher glue code always

The lskcipher glue code for skcipher needs to copy the IV every
time rather than only on the first and last request.  Otherwise
those algorithms that use IV to perform chaining may break, e.g.,
CBC.

This is because crypto_skcipher_import/export do not include the
IV as part of the saved state.

Reported-by: syzbot+b90b904ef6bdfdafec1d@syzkaller.appspotmail.com
Fixes: 662ea18d089b ("crypto: skcipher - Make use of internal state")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/lskcipher.c