Commit 6f6fc393 authored by Linus Torvalds's avatar Linus Torvalds

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
parents dff65843 e845d239
...@@ -373,7 +373,7 @@ void crypto_alg_tested(const char *name, int err) ...@@ -373,7 +373,7 @@ void crypto_alg_tested(const char *name, int err)
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)
......
...@@ -1940,7 +1940,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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);
......
...@@ -947,7 +947,7 @@ struct ahash_alg mv_md5_alg = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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 = { ...@@ -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,
......
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