All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Tadeusz Struk <tadeusz.struk@intel.com>, linux-crypto@vger.kernel.org
Subject: [v3 PATCH 3/3] crypto: algif_skcipher - Do not set MAY_BACKLOG on the async path
Date: Mon, 01 Feb 2016 21:08:03 +0800	[thread overview]
Message-ID: <E1aQED5-00022p-BA@gondolin.me.apana.org.au> (raw)
In-Reply-To: 20160201130644.GA6904@gondor.apana.org.au

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.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---

 crypto/algif_skcipher.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 2d549aa..41580b4 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -536,7 +536,7 @@ static int skcipher_recvmsg_async(struct socket *sock, struct msghdr *msg,
 	sg_init_table(sreq->tsg, tx_nents);
 	memcpy(iv, ctx->iv, ivsize);
 	skcipher_request_set_tfm(req, tfm);
-	skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
+	skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP,
 				      skcipher_async_cb, sreq);
 
 	while (iov_iter_count(&msg->msg_iter)) {
@@ -949,7 +949,8 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
 	ask->private = ctx;
 
 	skcipher_request_set_tfm(&ctx->req, skcipher);
-	skcipher_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_BACKLOG,
+	skcipher_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_SLEEP |
+						 CRYPTO_TFM_REQ_MAY_BACKLOG,
 				      af_alg_complete, &ctx->completion);
 
 	sk->sk_destruct = skcipher_sock_destruct;

      parent reply	other threads:[~2016-02-01 13:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 15:23 [PATCH v2 0/2] crypto: afalg_skcipher - fixes after skcipher conversion Tadeusz Struk
2016-01-28 15:24 ` [PATCH v2 1/2] crypto: skcipher - return the correct request to the user Tadeusz Struk
2016-01-28 15:24 ` [PATCH v2 2/2] crypto: algif_skcipher - fix async callback after skcipher convertion Tadeusz Struk
2016-02-01 13:06 ` [v3 PATCH 0/3] crypto: algif_skcipher - fixes after skcipher conversion Herbert Xu
2016-02-01 13:08   ` [v3 PATCH 1/3] crypto: algif_skcipher - Do not assume that req is unchanged Herbert Xu
2016-02-01 21:03     ` Tadeusz Struk
2016-02-03 13:36       ` [v4 PATCH 0/3] crypto: algif_skcipher - fixes after skcipher conversion Herbert Xu
2016-02-03 13:39         ` [v4 PATCH 1/3] crypto: algif_skcipher - Do not assume that req is unchanged Herbert Xu
2016-02-03 18:57           ` Tadeusz Struk
2016-02-03 13:39         ` [v4 PATCH 2/3] crypto: algif_skcipher - Do not dereference ctx without socket lock Herbert Xu
2016-02-03 13:39         ` [v4 PATCH 3/3] crypto: algif_skcipher - Do not set MAY_BACKLOG on the async path Herbert Xu
2016-02-01 13:08   ` [v3 PATCH 2/3] crypto: algif_skcipher - Do not dereference ctx without socket lock Herbert Xu
2016-02-01 13:08   ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1aQED5-00022p-BA@gondolin.me.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=tadeusz.struk@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.