aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-05-10 18:41:31 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-14 17:45:22 +0800
commit8a4e047c6cc07676f637608a9dd675349b5de0a7 (patch)
tree022655df30fd251c35c8eec57114935a796120e5 /drivers/crypto
parentcrypto: powerpc/poly1305 - Add SIMD fallback (diff)
downloadlinux-rng-8a4e047c6cc07676f637608a9dd675349b5de0a7.tar.xz
linux-rng-8a4e047c6cc07676f637608a9dd675349b5de0a7.zip
crypto: marvell/cesa - Handle zero-length skcipher requests
Do not access random memory for zero-length skcipher requests. Just return 0. Fixes: f63601fd616a ("crypto: marvell/cesa - add a new driver for Marvell's CESA") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/marvell/cesa/cipher.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/marvell/cesa/cipher.c b/drivers/crypto/marvell/cesa/cipher.c
index cf62db50f958..48c5c8ea8c43 100644
--- a/drivers/crypto/marvell/cesa/cipher.c
+++ b/drivers/crypto/marvell/cesa/cipher.c
@@ -459,6 +459,9 @@ static int mv_cesa_skcipher_queue_req(struct skcipher_request *req,
struct mv_cesa_skcipher_req *creq = skcipher_request_ctx(req);
struct mv_cesa_engine *engine;
+ if (!req->cryptlen)
+ return 0;
+
ret = mv_cesa_skcipher_req_init(req, tmpl);
if (ret)
return ret;