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

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 24 05:34:09 PDT 2016


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 at 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 at vger.kernel.org
    Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
    (cherry picked from commit b30bdfa86431afbafe15284a3ad5ac19b49b88e3)
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 crypto/gcm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
 


More information about the Devel mailing list