023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 1ad0f1603a6b2afb62a1c065409aaa4e43ca7627 Mon Sep 17 00:00:00 2001
  2. From: Eric Biggers <[email protected]>
  3. Date: Wed, 14 Nov 2018 12:19:39 -0800
  4. Subject: [PATCH 03/15] crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm
  5. allocations
  6. 'cipher' algorithms (single block ciphers) are always synchronous, so
  7. passing CRYPTO_ALG_ASYNC in the mask to crypto_alloc_cipher() has no
  8. effect. Many users therefore already don't pass it, but some still do.
  9. This inconsistency can cause confusion, especially since the way the
  10. 'mask' argument works is somewhat counterintuitive.
  11. Thus, just remove the unneeded CRYPTO_ALG_ASYNC flags.
  12. This patch shouldn't change any actual behavior.
  13. Signed-off-by: Eric Biggers <[email protected]>
  14. Signed-off-by: Herbert Xu <[email protected]>
  15. ---
  16. drivers/crypto/amcc/crypto4xx_alg.c | 3 +--
  17. 1 file changed, 1 insertion(+), 2 deletions(-)
  18. --- a/drivers/crypto/amcc/crypto4xx_alg.c
  19. +++ b/drivers/crypto/amcc/crypto4xx_alg.c
  20. @@ -540,8 +540,7 @@ static int crypto4xx_compute_gcm_hash_ke
  21. uint8_t src[16] = { 0 };
  22. int rc = 0;
  23. - aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC |
  24. - CRYPTO_ALG_NEED_FALLBACK);
  25. + aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_NEED_FALLBACK);
  26. if (IS_ERR(aes_tfm)) {
  27. rc = PTR_ERR(aes_tfm);
  28. pr_warn("could not load aes cipher driver: %d\n", rc);