]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tls: rx: assume crypto always calls our callback
authorJakub Kicinski <kuba@kernel.org>
Mon, 11 Apr 2022 19:19:12 +0000 (12:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:38:47 +0000 (14:38 +0000)
[ Upstream commit 1c699ffa48a15710746989c36a82cbfb07e8d17f ]

If crypto didn't always invoke our callback for async
we'd not be clearing skb->sk and would crash in the
skb core when freeing it. This if must be dead code.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: f7fa16d49837 ("tls: decrement decrypt_pending if no async completion will be called")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tls/tls_sw.c

index 85fa49170b4e54b84e41556d3e7b3737ba5b0045..27ac27daec868a0e9d7e176e5fae4634e79f68a7 100644 (file)
@@ -277,9 +277,6 @@ static int tls_do_decryption(struct sock *sk,
        if (ret == -EBADMSG)
                TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
 
-       if (async)
-               atomic_dec(&ctx->decrypt_pending);
-
        return ret;
 }