Skip to content

Commit dad4199

Browse files
committed
crypto: algif_skcipher - Do not set MAY_BACKLOG on the async path
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. Cc: [email protected] Signed-off-by: Herbert Xu <[email protected]>
1 parent 6454c2b commit dad4199

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crypto/algif_skcipher.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ static int skcipher_recvmsg_async(struct socket *sock, struct msghdr *msg,
536536
sg_init_table(sreq->tsg, tx_nents);
537537
memcpy(iv, ctx->iv, ivsize);
538538
skcipher_request_set_tfm(req, tfm);
539-
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
539+
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP,
540540
skcipher_async_cb, sreq);
541541

542542
while (iov_iter_count(&msg->msg_iter)) {
@@ -950,7 +950,8 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
950950
ask->private = ctx;
951951

952952
skcipher_request_set_tfm(&ctx->req, skcipher);
953-
skcipher_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_BACKLOG,
953+
skcipher_request_set_callback(&ctx->req, CRYPTO_TFM_REQ_MAY_SLEEP |
954+
CRYPTO_TFM_REQ_MAY_BACKLOG,
954955
af_alg_complete, &ctx->completion);
955956

956957
sk->sk_destruct = skcipher_sock_destruct;

0 commit comments

Comments
 (0)