summaryrefslogtreecommitdiff
path: root/crypto/lskcipher.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-12-21 10:42:57 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-12-22 12:30:19 +0800
commit439815751c2a41788c14ed3f0aca995570c0c1b6 (patch)
treed319c82e4d5df2151fc05c7ccdcf57df00a6849a /crypto/lskcipher.c
parente114d35c40f964027147349463178019e831d020 (diff)
downloadlinux-crypto-439815751c2a41788c14ed3f0aca995570c0c1b6.tar.gz
linux-crypto-439815751c2a41788c14ed3f0aca995570c0c1b6.zip
crypto: skcipher - Pass statesize for simple lskcipher instances
When ecb is used to wrap an lskcipher, the statesize isn't set correctly. Fix this by making the simple instance creator set the statesize. Reported-by: syzbot+8ffb0839a24e9c6bfa76@syzkaller.appspotmail.com Reported-by: Edward Adam Davis <eadavis@qq.com> Fixes: 0707e88b0fc9 ("crypto: skcipher - Make use of internal state") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/lskcipher.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/lskcipher.c b/crypto/lskcipher.c
index a06008e1..0b6dd8aa 100644
--- a/crypto/lskcipher.c
+++ b/crypto/lskcipher.c
@@ -642,6 +642,7 @@ struct lskcipher_instance *lskcipher_alloc_instance_simple(
inst->alg.co.min_keysize = cipher_alg->co.min_keysize;
inst->alg.co.max_keysize = cipher_alg->co.max_keysize;
inst->alg.co.ivsize = cipher_alg->co.base.cra_blocksize;
+ inst->alg.co.statesize = cipher_alg->co.statesize;
/* Use struct crypto_lskcipher * by default, can be overridden */
inst->alg.co.base.cra_ctxsize = sizeof(struct crypto_lskcipher *);