diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2022-04-11 12:19:10 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-06 14:38:47 +0000 |
| commit | 2ec59e16554992ccba9747a1b5e13fc482b0ed15 (patch) | |
| tree | a14b3a707d02c669962e2293880dd8e12770c7fd | |
| parent | b61dbb5ef449afe4e3d2d2298ebb5db52b33ef80 (diff) | |
| download | linux-2ec59e16554992ccba9747a1b5e13fc482b0ed15.tar.gz linux-2ec59e16554992ccba9747a1b5e13fc482b0ed15.tar.bz2 linux-2ec59e16554992ccba9747a1b5e13fc482b0ed15.zip | |
tls: rx: move counting TlsDecryptErrors for sync
[ Upstream commit 284b4d93daee56dff3e10029ddf2e03227f50dbf ]
Move counting TlsDecryptErrors to tls_do_decryption()
where differences between sync and async crypto are
reconciled.
No functional changes, this code just always gave
me a pause.
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>
| -rw-r--r-- | net/tls/tls_sw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index d3bbae9af9f4..85fa49170b4e 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -274,6 +274,8 @@ static int tls_do_decryption(struct sock *sk, ret = crypto_wait_req(ret, &ctx->async_wait); } + if (ret == -EBADMSG) + TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); if (async) atomic_dec(&ctx->decrypt_pending); @@ -1583,8 +1585,6 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb, if (err < 0) { if (err == -EINPROGRESS) tls_advance_record_sn(sk, prot, &tls_ctx->rx); - else if (err == -EBADMSG) - TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); return err; } |
