mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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: 8aee5d4ebd
("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>
This commit is contained in:
parent
d4f5bfe20d
commit
87d6621c07
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user