Linux-Crypto Archive on
 help / color / Atom feed
* [PATCH] crypto: algif_aead - Do not set MAY_BACKLOG on the async path
@ 2020-07-31  7:03 Herbert Xu
  0 siblings, 0 replies; only message in thread
From: Herbert Xu @ 2020-07-31  7:03 UTC (permalink / raw)
  To: Linux Crypto Mailing List

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 <>

diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index d48d2156e6210..d733c8b74bee3 100644
--- a/crypto/algif_aead.c
+++ b/crypto/algif_aead.c
@@ -78,7 +78,7 @@ static int crypto_aead_copy_sgl(struct crypto_sync_skcipher *null_tfm,
 	skcipher_request_set_sync_tfm(skreq, null_tfm);
-	skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_BACKLOG,
+	skcipher_request_set_callback(skreq, CRYPTO_TFM_REQ_MAY_SLEEP,
 				      NULL, NULL);
 	skcipher_request_set_crypt(skreq, src, dst, len, NULL);
@@ -291,19 +291,20 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
 		areq->outlen = outlen;
 					  af_alg_async_cb, areq);
 		err = ctx->enc ? crypto_aead_encrypt(&areq->cra_u.aead_req) :
 		/* AIO operation in progress */
-		if (err == -EINPROGRESS || err == -EBUSY)
+		if (err == -EINPROGRESS)
 			return -EIOCBQUEUED;
 	} else {
 		/* Synchronous operation */
 					  crypto_req_done, &ctx->wait);
 		err = crypto_wait_req(ctx->enc ?
Email: Herbert Xu <>
Home Page:
PGP Key:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  7:03 [PATCH] crypto: algif_aead - Do not set MAY_BACKLOG on the async path Herbert Xu

Linux-Crypto Archive on

Archives are clonable:
	git clone --mirror linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ \
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone