Revert "tls: rx: move counting TlsDecryptErrors for sync"
authorGal Pressman <gal@nvidia.com>
Tue, 5 Jul 2022 11:08:37 +0000 (14:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jul 2022 12:10:59 +0000 (13:10 +0100)
commita069a90554168ac4cc81af65f000557d2a8a0745
tree1f536025f74e954c908d37d0a322f2726f0fcc22
parentae9fdf6cb4da4265bdc3a574d06eaad02a7f669a
Revert "tls: rx: move counting TlsDecryptErrors for sync"

This reverts commit 284b4d93daee56dff3e10029ddf2e03227f50dbf.
When using TLS device offload and coming from tls_device_reencrypt()
flow, -EBADMSG error in tls_do_decryption() should not be counted
towards the TLSTlsDecryptError counter.

Move the counter increase back to the decrypt_internal() call site in
decrypt_skb_update().
This also fixes an issue where:
if (n_sgin < 1)
return -EBADMSG;

Errors in decrypt_internal() were not counted after the cited patch.

Fixes: 284b4d93daee ("tls: rx: move counting TlsDecryptErrors for sync")
Cc: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c