Patch "tls: decrement decrypt_pending if no async completion will be called" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tls: decrement decrypt_pending if no async completion will be called

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tls-decrement-decrypt_pending-if-no-async-completion.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 03e9f590f26218cbe1c817338e5616a632b4c6e8
Author: Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>
Date:   Wed Feb 28 23:43:57 2024 +0100

    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@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/c56d5fc35543891d5319f834f25622360e1bfbec.1709132643.git.sd@xxxxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index de96959336c48..9f23ba321efe6 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;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux