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 ab2a5a5d05b3eb3af8a22e69e0dde97590956154
Author: Wang, Rui Y <[email protected]>
Date:   Mon Oct 24 16:34:06 2016 +0400

    ms/crypto: algif_hash - wait for crypto_ahash_init() to complete
    
    hash_sendmsg/sendpage() need to wait for the completion
    of crypto_ahash_init() otherwise it can cause panic.
    
    Cc: [email protected]
    Signed-off-by: Rui Wang <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    (cherry picked from commit fe09786178f9df713a4b2dd6b93c0a722346bf5e)
    Signed-off-by: Andrey Ryabinin <[email protected]>
---
 crypto/algif_hash.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
index 7a70b07..7bc3f89 100644
--- a/crypto/algif_hash.c
+++ b/crypto/algif_hash.c
@@ -56,7 +56,8 @@ static int hash_sendmsg(struct kiocb *unused, struct socket 
*sock,
 
        lock_sock(sk);
        if (!ctx->more) {
-               err = crypto_ahash_init(&ctx->req);
+               err = af_alg_wait_for_completion(crypto_ahash_init(&ctx->req),
+                                               &ctx->completion);
                if (err)
                        goto unlock;
        }
@@ -136,6 +137,7 @@ static ssize_t hash_sendpage(struct socket *sock, struct 
page *page,
        } else {
                if (!ctx->more) {
                        err = crypto_ahash_init(&ctx->req);
+                       err = af_alg_wait_for_completion(err, &ctx->completion);
                        if (err)
                                goto unlock;
                }
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to