Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933468AbdIXUxO (ORCPT ); Sun, 24 Sep 2017 16:53:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60832 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933322AbdIXUmo (ORCPT ); Sun, 24 Sep 2017 16:42:44 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Herbert Xu Subject: [PATCH 4.13 031/109] crypto: scompress - dont sleep with preemption disabled Date: Sun, 24 Sep 2017 22:32:52 +0200 Message-Id: <20170924203354.331229425@linuxfoundation.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170924203353.104695385@linuxfoundation.org> References: <20170924203353.104695385@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1152 Lines: 35 4.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ard Biesheuvel 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 Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/scompress.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -211,9 +211,7 @@ static int scomp_acomp_comp_decomp(struc 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; }