]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
crypto: scompress - don't sleep with preemption disabled
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 21 Jul 2017 15:42:36 +0000 (16:42 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 14:34:53 +0000 (10:34 -0400)
BugLink: http://bugs.launchpad.net/bugs/1720154
commit 3c08377262880afc1621ab9cb6dbe7df47a6033d upstream.

Due to the use of per-CPU buffers, scomp_acomp_comp_decomp() executes
with preemption disabled, and so whether the CRYPTO_TFM_REQ_MAY_SLEEP
flag is set is irrelevant, since we cannot sleep anyway. So disregard
the flag, and use GFP_ATOMIC unconditionally.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
crypto/scompress.c

index ae1d3cf209e4836b5cdbdf0e261caa9190e59bb4..0b40d991d65f6f8c65a4d1a7914aa981b2b35ed4 100644 (file)
@@ -211,9 +211,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
                                              scratch_dst, &req->dlen, *ctx);
        if (!ret) {
                if (!req->dst) {
-                       req->dst = crypto_scomp_sg_alloc(req->dlen,
-                                  req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
-                                  GFP_KERNEL : GFP_ATOMIC);
+                       req->dst = crypto_scomp_sg_alloc(req->dlen, GFP_ATOMIC);
                        if (!req->dst)
                                goto out;
                }