Commit 87d6621c authored by Herbert Xu's avatar Herbert Xu

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: 8aee5d4e ("crypto: lskcipher - Add compatibility wrapper around ECB")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202310111323.ZjK7bzjw-lkp@intel.com/Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d4f5bfe2
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment