Skip to content

Commit f7fa16d

Browse files
qsnkuba-moo
authored andcommitted
tls: decrement decrypt_pending if no async completion will be called
With mixed sync/async decryption, or failures of crypto_aead_decrypt, we increment decrypt_pending but we never do the corresponding decrement since tls_decrypt_done will not be called. In this case, we should decrement decrypt_pending immediately to avoid getting stuck. For example, the prequeue prequeue test gets stuck with mixed modes (one async decrypt + one sync decrypt). Fixes: 94524d8 ("net/tls: Add support for async decryption of tls records") Signed-off-by: Sabrina Dubroca <[email protected]> Link: https://lore.kernel.org/r/c56d5fc35543891d5319f834f25622360e1bfbec.1709132643.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 616d82c commit f7fa16d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/tls/tls_sw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ static int tls_do_decryption(struct sock *sk,
289289
return 0;
290290

291291
ret = crypto_wait_req(ret, &ctx->async_wait);
292+
} else if (darg->async) {
293+
atomic_dec(&ctx->decrypt_pending);
292294
}
293295
darg->async = false;
294296

0 commit comments

Comments
 (0)