[Devel,RHEL7,COMMIT] ms/crypto: gcm - Filter out async ghash if necessary

Submitted by Konstantin Khorenko on Oct. 24, 2016, 12:34 p.m.

Details

Message ID 201610241234.u9OCY9t2024855@finist_cl7.x64_64.work.ct
State New
Series "ms/crypto: gcm - Filter out async ghash if necessary"
Headers show

Commit Message

Konstantin Khorenko Oct. 24, 2016, 12:34 p.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.19.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.19.3
------>
commit cd8bf26dd293d112593df14d740442eb742ce914
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Mon Oct 24 16:34:09 2016 +0400

    ms/crypto: gcm - Filter out async ghash if necessary
    
    As it is if you ask for a sync gcm you may actually end up with
    an async one because it does not filter out async implementations
    of ghash.
    
    This patch fixes this by adding the necessary filter when looking
    for ghash.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    (cherry picked from commit b30bdfa86431afbafe15284a3ad5ac19b49b88e3)
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 crypto/gcm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/crypto/gcm.c b/crypto/gcm.c
index f0bd00b..d2a0f737 100644
--- a/crypto/gcm.c
+++ b/crypto/gcm.c
@@ -716,7 +716,9 @@  static struct crypto_instance *crypto_gcm_alloc_common(struct rtattr **tb,
 
 	ghash_alg = crypto_find_alg(ghash_name, &crypto_ahash_type,
 				    CRYPTO_ALG_TYPE_HASH,
-				    CRYPTO_ALG_TYPE_AHASH_MASK);
+				    CRYPTO_ALG_TYPE_AHASH_MASK |
+				    crypto_requires_sync(algt->type,
+							 algt->mask));
 	if (IS_ERR(ghash_alg))
 		return ERR_CAST(ghash_alg);