Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp613656pxx; Wed, 28 Oct 2020 12:25:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQvpD92auHJ9UaIHN0Fa/U68M5QTeamwAkcEYKxiBgWowtiGMRKiUCBtMGCB7pqutic/cN X-Received: by 2002:a17:907:118c:: with SMTP id uz12mr675930ejb.98.1603913126959; Wed, 28 Oct 2020 12:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603913126; cv=none; d=google.com; s=arc-20160816; b=RouJ8dsAbg+v1FjZKAu2BNE8BkOIObwFYWJtetrOa5GJdV1WiBVp1LT+K87EQkI78i je49slcR3RBS5Kiusgu3fyL+tkqyyelGDEltfk7N+7ScyPr/x/TPr19dTtYZvzHG4YIf rrebA8S5dI6hxQHWOtNlE6nZ3kkvxmfpyrzuOxeHgDXJxqw7GIWYmUPmsLYdQt+njRtn LJE0UFMxLC04TxrF4bitKCDu/dvAe1gm9/ZdkfMtI1FdVf2qHscJRReyZz3scJlfePnj yz8/zIf23L+Fn43N9CrHfEnWjDPjQ88HKogfinhH2uNVrF2X0/bgkleGJLWTo1F8hdVB +r6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U9UJ9Cz7UeZ92m55aVKl3+PUkjP2iEdzVkuCKJxalew=; b=CDMfDTy4saTLbu92Cn9a9775h/Y3RtC4ULlBFo3K2jiKY+tcgV9tT4erQ821CACBcO GK686CAd0QIvsbAPnxmkEsCja0pSZ64Y2FVhMlJGHwNaWQNfbkBP/bQEnLMod+2rpcVs dQnGbacAcgyIQsBEPWKUguD53k8sn3G74tjxHuJyJILk/+2Pq2dKDvy+T1JjW7oCOdRs nvDlMOwGzhy328yRIlofJLn67TU6sKEzYK7YQ/7j26y024Hg4JNF8C2ccl7n65QG12BP ciVG10r/5+f8/EAH9h2RsljfQF0T9Uml9AyMpMwc8B5uNomcEo5ddu2ktf30iAGvrU6Y f/aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DiCbnKjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si179023edx.375.2020.10.28.12.25.04; Wed, 28 Oct 2020 12:25:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DiCbnKjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1827314AbgJ0SW5 (ORCPT + 99 others); Tue, 27 Oct 2020 14:22:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442688AbgJ0OCL (ORCPT ); Tue, 27 Oct 2020 10:02:11 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 F1F0A221F8; Tue, 27 Oct 2020 14:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807331; bh=Wk+aSI7U0jXX/ygkhc1AR8h7iyiQ+5au4OFs/6FHIJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DiCbnKjfpAOwfRwNsVQp6wxefKw6lfAJGk041nvAdAFafK5JHhZTMDatrNc5E4QTk m6Rzpy8PF0hsTf/ITKKVos08dsF6dBew3jnqiGRrh3rJHtBE9QABi7w6qd+2dPxDic QOZNV5Pk/Vqb546FePrZdUjy498GUR9eTP2KA7So= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Herbert Xu Subject: [PATCH 4.9 014/139] crypto: algif_aead - Do not set MAY_BACKLOG on the async path Date: Tue, 27 Oct 2020 14:48:28 +0100 Message-Id: <20201027134902.824334213@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Herbert Xu commit cbdad1f246dd98e6c9c32a6e5212337f542aa7e0 upstream. The async path cannot use MAY_BACKLOG because it is not meant to block, which is what MAY_BACKLOG does. On the other hand, both the sync and async paths can make use of MAY_SLEEP. Fixes: 83094e5e9e49 ("crypto: af_alg - add async support to...") Cc: Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/algif_aead.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -455,7 +455,7 @@ static int aead_recvmsg_async(struct soc memcpy(areq->iv, ctx->iv, crypto_aead_ivsize(tfm)); aead_request_set_tfm(req, tfm); aead_request_set_ad(req, ctx->aead_assoclen); - aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, + aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP, aead_async_cb, req); used -= ctx->aead_assoclen; @@ -925,7 +925,7 @@ static int aead_accept_parent_nokey(void ask->private = ctx; aead_request_set_tfm(&ctx->aead_req, aead); - aead_request_set_callback(&ctx->aead_req, CRYPTO_TFM_REQ_MAY_BACKLOG, + aead_request_set_callback(&ctx->aead_req, CRYPTO_TFM_REQ_MAY_SLEEP, af_alg_complete, &ctx->completion); sk->sk_destruct = aead_sock_destruct;