diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2024-02-28 23:43:57 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-06 14:48:36 +0000 |
commit | c19fdb06d3d7759cc024a7f28ce21ba870c73840 (patch) | |
tree | c103bed8d2d16dca0a06ac82d9f748d34710af59 /net/tls | |
parent | 9422350aea63f05eafad3efafd6e0d4adde01a26 (diff) | |
download | linux-stable-c19fdb06d3d7759cc024a7f28ce21ba870c73840.tar.gz linux-stable-c19fdb06d3d7759cc024a7f28ce21ba870c73840.tar.bz2 linux-stable-c19fdb06d3d7759cc024a7f28ce21ba870c73840.zip |
tls: decrement decrypt_pending if no async completion will be called
[ Upstream commit f7fa16d49837f947ee59492958f9e6f0e51d9a78 ]
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: 94524d8fc965 ("net/tls: Add support for async decryption of tls records")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/c56d5fc35543891d5319f834f25622360e1bfbec.1709132643.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/tls')
-rw-r--r-- | net/tls/tls_sw.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 5238886e6186..adc65a21cd66 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -289,6 +289,8 @@ static int tls_do_decryption(struct sock *sk, return 0; ret = crypto_wait_req(ret, &ctx->async_wait); + } else if (darg->async) { + atomic_dec(&ctx->decrypt_pending); } darg->async = false; |