This is a note to let you know that I've just added the patch titled Revert "tls: rx: move counting TlsDecryptErrors for sync" to the 5.15-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: revert-tls-rx-move-counting-tlsdecrypterrors-for-sync.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a069a90554168ac4cc81af65f000557d2a8a0745 Mon Sep 17 00:00:00 2001 From: Gal Pressman <gal@xxxxxxxxxx> Date: Tue, 5 Jul 2022 14:08:37 +0300 Subject: Revert "tls: rx: move counting TlsDecryptErrors for sync" From: Gal Pressman <gal@xxxxxxxxxx> commit a069a90554168ac4cc81af65f000557d2a8a0745 upstream. 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@xxxxxxxxxx> Reviewed-by: Maxim Mikityanskiy <maximmi@xxxxxxxxxx> Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxx> Signed-off-by: Gal Pressman <gal@xxxxxxxxxx> Reviewed-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/tls/tls_sw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -278,9 +278,6 @@ static int tls_do_decryption(struct sock } darg->async = false; - if (ret == -EBADMSG) - TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); - return ret; } @@ -1585,8 +1582,11 @@ static int decrypt_skb_update(struct soc } err = decrypt_internal(sk, skb, dest, NULL, darg); - if (err < 0) + if (err < 0) { + if (err == -EBADMSG) + TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); return err; + } if (darg->async) goto decrypt_next; Patches currently in stable-queue which might be from gal@xxxxxxxxxx are queue-5.15/net-tls-fix-async-vs-nic-crypto-offload.patch queue-5.15/revert-tls-rx-move-counting-tlsdecrypterrors-for-sync.patch