This push fixes the following issues:

- Remove bogus ENOENT error messages.
 - Ensure algorithm is still alive before marking it as tested.
 - Disable buggy hash algorithms in marvell/cesa.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmcHmRcACgkQxycdCkmx
 i6eHuQ//XhW5CmxdEa405rZdXeIh4Sid7f1lbgbRzIevCuNKBFkhEZgcEFphy/VS
 R6acuzqfh2oZoIuvj9D6o0KoW7BrZ2zANedlHyjvoU/fPK5CXilcRz+hgwINIzfC
 G1xL9zLsBXesRMuWdRi2Wez2/w/GEm6QaHPDIcv9uEgUt/MKKKW6lHNZiBV+z+p8
 iHfqJaKv6H3VCSvoJ8RadlQZDArMXmYZsb8vX56xiuD4Zqq5uMknlSLxtEYo97cn
 OaIuumzTrzZYzGExr1Q8sUoOHWIi2rLGDuCshVtkSPnK+lORDuZlGsBcBZfUdLs+
 OSqKb7w59XnbOLychtrn1oaEWjosL/lYMHR+xjY/5QzrGT7aa6Jh571NjFfkg2Yt
 51b/iKFn7l/gmS4GM3F/qqxpRADbiwMInlOY8Xurbd92NUmGurS7U5R1V+arLfim
 e5vgrZAEIFyJsiXaLhBf/dQ2pT8T10IAsGo6TNt6MOMdAi3BKCah7m1i14+0CRlR
 y6/u7ccRINuoGElZP0nbqR0KyU8LvFXe+QYaBLVZ1+2cXZ8F+Zau5aSK6JkKoPVd
 zJ0PyPpRzHio0o1Rdj1i8zGmUzsqgWHEFj7gGbh798OVRZw3DfC2YZkGqSS2iG7U
 VIGbxuEdwSdJYPepYosFNmSUB448I2ifz2V0QTBNWnW8z/HK+xA=
 =2MUc
 -----END PGP SIGNATURE-----

Merge tag 'v6.12-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:

 - Remove bogus testmgr ENOENT error messages

 - Ensure algorithm is still alive before marking it as tested

 - Disable buggy hash algorithms in marvell/cesa

* tag 'v6.12-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: marvell/cesa - Disable hash algorithms
  crypto: testmgr - Hide ENOENT errors better
  crypto: api - Fix liveliness check in crypto_alg_tested
This commit is contained in:
Linus Torvalds 2024-10-16 08:42:54 -07:00
commit 6f6fc393f4
3 changed files with 18 additions and 19 deletions

View File

@ -373,7 +373,7 @@ found:
q->cra_flags |= CRYPTO_ALG_DEAD; q->cra_flags |= CRYPTO_ALG_DEAD;
alg = test->adult; alg = test->adult;
if (list_empty(&alg->cra_list)) if (crypto_is_dead(alg))
goto complete; goto complete;
if (err == -ECANCELED) if (err == -ECANCELED)

View File

@ -1940,7 +1940,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs,
atfm = crypto_alloc_ahash(driver, type, mask); atfm = crypto_alloc_ahash(driver, type, mask);
if (IS_ERR(atfm)) { if (IS_ERR(atfm)) {
if (PTR_ERR(atfm) == -ENOENT) if (PTR_ERR(atfm) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: hash: failed to allocate transform for %s: %ld\n", pr_err("alg: hash: failed to allocate transform for %s: %ld\n",
driver, PTR_ERR(atfm)); driver, PTR_ERR(atfm));
return PTR_ERR(atfm); return PTR_ERR(atfm);
@ -2706,7 +2706,7 @@ static int alg_test_aead(const struct alg_test_desc *desc, const char *driver,
tfm = crypto_alloc_aead(driver, type, mask); tfm = crypto_alloc_aead(driver, type, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
if (PTR_ERR(tfm) == -ENOENT) if (PTR_ERR(tfm) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: aead: failed to allocate transform for %s: %ld\n", pr_err("alg: aead: failed to allocate transform for %s: %ld\n",
driver, PTR_ERR(tfm)); driver, PTR_ERR(tfm));
return PTR_ERR(tfm); return PTR_ERR(tfm);
@ -3285,7 +3285,7 @@ static int alg_test_skcipher(const struct alg_test_desc *desc,
tfm = crypto_alloc_skcipher(driver, type, mask); tfm = crypto_alloc_skcipher(driver, type, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
if (PTR_ERR(tfm) == -ENOENT) if (PTR_ERR(tfm) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: skcipher: failed to allocate transform for %s: %ld\n", pr_err("alg: skcipher: failed to allocate transform for %s: %ld\n",
driver, PTR_ERR(tfm)); driver, PTR_ERR(tfm));
return PTR_ERR(tfm); return PTR_ERR(tfm);
@ -3700,7 +3700,7 @@ static int alg_test_cipher(const struct alg_test_desc *desc,
tfm = crypto_alloc_cipher(driver, type, mask); tfm = crypto_alloc_cipher(driver, type, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
if (PTR_ERR(tfm) == -ENOENT) if (PTR_ERR(tfm) == -ENOENT)
return -ENOENT; return 0;
printk(KERN_ERR "alg: cipher: Failed to load transform for " printk(KERN_ERR "alg: cipher: Failed to load transform for "
"%s: %ld\n", driver, PTR_ERR(tfm)); "%s: %ld\n", driver, PTR_ERR(tfm));
return PTR_ERR(tfm); return PTR_ERR(tfm);
@ -3726,7 +3726,7 @@ static int alg_test_comp(const struct alg_test_desc *desc, const char *driver,
acomp = crypto_alloc_acomp(driver, type, mask); acomp = crypto_alloc_acomp(driver, type, mask);
if (IS_ERR(acomp)) { if (IS_ERR(acomp)) {
if (PTR_ERR(acomp) == -ENOENT) if (PTR_ERR(acomp) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: acomp: Failed to load transform for %s: %ld\n", pr_err("alg: acomp: Failed to load transform for %s: %ld\n",
driver, PTR_ERR(acomp)); driver, PTR_ERR(acomp));
return PTR_ERR(acomp); return PTR_ERR(acomp);
@ -3740,7 +3740,7 @@ static int alg_test_comp(const struct alg_test_desc *desc, const char *driver,
comp = crypto_alloc_comp(driver, type, mask); comp = crypto_alloc_comp(driver, type, mask);
if (IS_ERR(comp)) { if (IS_ERR(comp)) {
if (PTR_ERR(comp) == -ENOENT) if (PTR_ERR(comp) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: comp: Failed to load transform for %s: %ld\n", pr_err("alg: comp: Failed to load transform for %s: %ld\n",
driver, PTR_ERR(comp)); driver, PTR_ERR(comp));
return PTR_ERR(comp); return PTR_ERR(comp);
@ -3818,7 +3818,7 @@ static int alg_test_cprng(const struct alg_test_desc *desc, const char *driver,
rng = crypto_alloc_rng(driver, type, mask); rng = crypto_alloc_rng(driver, type, mask);
if (IS_ERR(rng)) { if (IS_ERR(rng)) {
if (PTR_ERR(rng) == -ENOENT) if (PTR_ERR(rng) == -ENOENT)
return -ENOENT; return 0;
printk(KERN_ERR "alg: cprng: Failed to load transform for %s: " printk(KERN_ERR "alg: cprng: Failed to load transform for %s: "
"%ld\n", driver, PTR_ERR(rng)); "%ld\n", driver, PTR_ERR(rng));
return PTR_ERR(rng); return PTR_ERR(rng);
@ -3846,12 +3846,11 @@ static int drbg_cavs_test(const struct drbg_testvec *test, int pr,
drng = crypto_alloc_rng(driver, type, mask); drng = crypto_alloc_rng(driver, type, mask);
if (IS_ERR(drng)) { if (IS_ERR(drng)) {
kfree_sensitive(buf);
if (PTR_ERR(drng) == -ENOENT) if (PTR_ERR(drng) == -ENOENT)
goto out_no_rng; return 0;
printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for " printk(KERN_ERR "alg: drbg: could not allocate DRNG handle for "
"%s\n", driver); "%s\n", driver);
out_no_rng:
kfree_sensitive(buf);
return PTR_ERR(drng); return PTR_ERR(drng);
} }
@ -4095,7 +4094,7 @@ static int alg_test_kpp(const struct alg_test_desc *desc, const char *driver,
tfm = crypto_alloc_kpp(driver, type, mask); tfm = crypto_alloc_kpp(driver, type, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
if (PTR_ERR(tfm) == -ENOENT) if (PTR_ERR(tfm) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: kpp: Failed to load tfm for %s: %ld\n", pr_err("alg: kpp: Failed to load tfm for %s: %ld\n",
driver, PTR_ERR(tfm)); driver, PTR_ERR(tfm));
return PTR_ERR(tfm); return PTR_ERR(tfm);
@ -4325,7 +4324,7 @@ static int alg_test_akcipher(const struct alg_test_desc *desc,
tfm = crypto_alloc_akcipher(driver, type, mask); tfm = crypto_alloc_akcipher(driver, type, mask);
if (IS_ERR(tfm)) { if (IS_ERR(tfm)) {
if (PTR_ERR(tfm) == -ENOENT) if (PTR_ERR(tfm) == -ENOENT)
return -ENOENT; return 0;
pr_err("alg: akcipher: Failed to load tfm for %s: %ld\n", pr_err("alg: akcipher: Failed to load tfm for %s: %ld\n",
driver, PTR_ERR(tfm)); driver, PTR_ERR(tfm));
return PTR_ERR(tfm); return PTR_ERR(tfm);

View File

@ -947,7 +947,7 @@ struct ahash_alg mv_md5_alg = {
.base = { .base = {
.cra_name = "md5", .cra_name = "md5",
.cra_driver_name = "mv-md5", .cra_driver_name = "mv-md5",
.cra_priority = 300, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY | CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_KERN_DRIVER_ONLY,
@ -1018,7 +1018,7 @@ struct ahash_alg mv_sha1_alg = {
.base = { .base = {
.cra_name = "sha1", .cra_name = "sha1",
.cra_driver_name = "mv-sha1", .cra_driver_name = "mv-sha1",
.cra_priority = 300, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY | CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_KERN_DRIVER_ONLY,
@ -1092,7 +1092,7 @@ struct ahash_alg mv_sha256_alg = {
.base = { .base = {
.cra_name = "sha256", .cra_name = "sha256",
.cra_driver_name = "mv-sha256", .cra_driver_name = "mv-sha256",
.cra_priority = 300, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY | CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_KERN_DRIVER_ONLY,
@ -1302,7 +1302,7 @@ struct ahash_alg mv_ahmac_md5_alg = {
.base = { .base = {
.cra_name = "hmac(md5)", .cra_name = "hmac(md5)",
.cra_driver_name = "mv-hmac-md5", .cra_driver_name = "mv-hmac-md5",
.cra_priority = 300, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY | CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_KERN_DRIVER_ONLY,
@ -1373,7 +1373,7 @@ struct ahash_alg mv_ahmac_sha1_alg = {
.base = { .base = {
.cra_name = "hmac(sha1)", .cra_name = "hmac(sha1)",
.cra_driver_name = "mv-hmac-sha1", .cra_driver_name = "mv-hmac-sha1",
.cra_priority = 300, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY | CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_KERN_DRIVER_ONLY,
@ -1444,7 +1444,7 @@ struct ahash_alg mv_ahmac_sha256_alg = {
.base = { .base = {
.cra_name = "hmac(sha256)", .cra_name = "hmac(sha256)",
.cra_driver_name = "mv-hmac-sha256", .cra_driver_name = "mv-hmac-sha256",
.cra_priority = 300, .cra_priority = 0,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY | CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY, CRYPTO_ALG_KERN_DRIVER_ONLY,