]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - crypto/ablk_helper.c
crypto: ablk_helper - Fix cryptd reordering
[mirror_ubuntu-artful-kernel.git] / crypto / ablk_helper.c
index e1fcf53bb931f1832e34591063cab0f5abc1d9b2..1441f07d0a199b4be976d9f7073282195c5259e1 100644 (file)
@@ -71,7 +71,8 @@ int ablk_encrypt(struct ablkcipher_request *req)
        struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
        struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm);
 
-       if (!may_use_simd()) {
+       if (!may_use_simd() ||
+           (in_atomic() && cryptd_ablkcipher_queued(ctx->cryptd_tfm))) {
                struct ablkcipher_request *cryptd_req =
                        ablkcipher_request_ctx(req);
 
@@ -90,7 +91,8 @@ int ablk_decrypt(struct ablkcipher_request *req)
        struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
        struct async_helper_ctx *ctx = crypto_ablkcipher_ctx(tfm);
 
-       if (!may_use_simd()) {
+       if (!may_use_simd() ||
+           (in_atomic() && cryptd_ablkcipher_queued(ctx->cryptd_tfm))) {
                struct ablkcipher_request *cryptd_req =
                        ablkcipher_request_ctx(req);