Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Gal Pressman and committed by
David S. Miller
a069a905 ae9fdf6c

+4 -4
+4 -4
net/tls/tls_sw.c
··· 267 267 } 268 268 darg->async = false; 269 269 270 - if (ret == -EBADMSG) 271 - TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); 272 - 273 270 return ret; 274 271 } 275 272 ··· 1576 1579 } 1577 1580 1578 1581 err = decrypt_internal(sk, skb, dest, NULL, darg); 1579 - if (err < 0) 1582 + if (err < 0) { 1583 + if (err == -EBADMSG) 1584 + TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); 1580 1585 return err; 1586 + } 1581 1587 if (darg->async) 1582 1588 goto decrypt_next; 1583 1589