Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4812935yba; Tue, 30 Apr 2019 04:56:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdOUCKUl6ZvD8Pn0ciVA9U31Io42BeyPTG7ffJQHC6t1niDHF27T2Uil7+UTzPzRRvx6Gn X-Received: by 2002:a65:6205:: with SMTP id d5mr19830969pgv.61.1556625407677; Tue, 30 Apr 2019 04:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625407; cv=none; d=google.com; s=arc-20160816; b=m/tGPRIOYPFo0DyfUGElPcpKWDqa1qGXjbT+eLP9fS8UgVKHR9IT/rHT5C/C48tyt/ 36Yw0+RbdZzOLXGO2wDTzOszwoQle5+KSxu/FvlDoimCajZfJlUsYHnVg1Ii6Ep0gMCc upSgmYoY8xcsTZDrz8j8eXmpTXlV7hvwpnQ6jJ4Yj1e85wRjVRLYTIZAchI9BbYthDvs zWJYDxyH762TnCUej9B1gGeR6x4EoYIda0oebKyt4KBh0f4G7oJWnoL9A4sF1/uSq6xM k9unQaAPmOpzYAyh1t0xOUKIPIT4y+UlDApciuip66WXRNSGbNa2SY5O28yBsqAQoM6N S29g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zcsbvXcFXJnfBiBFC0vx9370cV3A5nGjMbkM1cGCIqQ=; b=ePTN2hr8HWCNuKz4FiwW9g5vl4CUVr6Q1Ohz5svxghq3R86Xsu19FEfstGRZNfp41x bTyAoUOfS6tB9D3xFoQ132nnepbgNGX39Flk0x0YDgQuF24FCLLuoenwGy0sEp2z95+X +/8jWn9nCazLuix685y8zdsSbgUI8EpyolmiReZtASHxMfB8UeylFyAHfNmCGXL6K44y qRCOLauO5orpvq63yd19jOzYUtFaLbjeYFbr3xqHSJVclh2oBBlgq7MgilrSeZY4EczS 6XMW1a0RIun6oL72ESmNh8mnO50gizheL83q3wfqauArFN5P8TwEfPKk4sNvMJHDVbdQ ySyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ggar+msA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si15829057plq.227.2019.04.30.04.56.32; Tue, 30 Apr 2019 04:56:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ggar+msA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731073AbfD3Ltv (ORCPT + 99 others); Tue, 30 Apr 2019 07:49:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:36478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731059AbfD3Ltt (ORCPT ); Tue, 30 Apr 2019 07:49:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 972D020449; Tue, 30 Apr 2019 11:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556624989; bh=JA1cVPFQA7jeyfiTzE+eEd+tw3Y5fVwIqMIbkAFPUu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ggar+msAAGljK0YRtHuCxuwjdZ9HA2itIZ1TPDuPxEkYEypOCcDvzMYa1Bb+u+XCg 5WRjDvZQtKrzPPLhIeKblsxfBl+Mi5O/4Hnfbhw3tlrB4n19u9DsW5qPEXvy+4SwDj mSc8pnl7XXThrnF/dVnA5sdhAc1bzfHFkGS6wayE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herbert Xu , Ondrej Mosnacek Subject: [PATCH 5.0 14/89] crypto: lrw - Fix atomic sleep when walking skcipher Date: Tue, 30 Apr 2019 13:38:05 +0200 Message-Id: <20190430113610.371633316@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Herbert Xu commit b257b48cd5830c5b1d0c347eb281f9c28056f881 upstream. When we perform a walk in the completion function, we need to ensure that it is atomic. Fixes: ac3c8f36c31d ("crypto: lrw - Do not use auxiliary buffer") Cc: Signed-off-by: Herbert Xu Acked-by: Ondrej Mosnacek Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/lrw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -212,8 +212,12 @@ static void crypt_done(struct crypto_asy { struct skcipher_request *req = areq->data; - if (!err) + if (!err) { + struct rctx *rctx = skcipher_request_ctx(req); + + rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; err = xor_tweak_post(req); + } skcipher_request_complete(req, err); }