summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-10-12 07:11:25 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-20 07:39:26 +0200
commit87d6621c07d230d9168a021f2760062f2262e8b9 (patch)
tree035abdb5ae2ebca42e901d31bbd5196047291be1 /crypto
parentcerts: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512 (diff)
downloadlinux-87d6621c07d230d9168a021f2760062f2262e8b9.tar.xz
linux-87d6621c07d230d9168a021f2760062f2262e8b9.zip
crypto: lskcipher - Return EINVAL when ecb_name fails sanity checks
Set the error value to -EINVAL instead of zero when the underlying name (within "ecb()") fails basic sanity checks. Fixes: 8aee5d4ebd11 ("crypto: lskcipher - Add compatibility wrapper around ECB") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202310111323.ZjK7bzjw-lkp@intel.com/ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/lskcipher.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/lskcipher.c b/crypto/lskcipher.c
index 9be3c04bc62a..cb6170ebcaa3 100644
--- a/crypto/lskcipher.c
+++ b/crypto/lskcipher.c
@@ -583,6 +583,7 @@ struct lskcipher_instance *lskcipher_alloc_instance_simple(
if (ecb_name[0]) {
int len;
+ err = -EINVAL;
len = strscpy(ecb_name, &cipher_alg->co.base.cra_name[4],
sizeof(ecb_name));
if (len < 2)