Skip to content

Commit a069a90

Browse files
gal-pressmandavem330
authored andcommitted
Revert "tls: rx: move counting TlsDecryptErrors for sync"
This reverts commit 284b4d9. 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: 284b4d9 ("tls: rx: move counting TlsDecryptErrors for sync") Cc: Jakub Kicinski <[email protected]> Reviewed-by: Maxim Mikityanskiy <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Gal Pressman <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ae9fdf6 commit a069a90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/tls/tls_sw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ static int tls_do_decryption(struct sock *sk,
267267
}
268268
darg->async = false;
269269

270-
if (ret == -EBADMSG)
271-
TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
272-
273270
return ret;
274271
}
275272

@@ -1579,8 +1576,11 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb,
15791576
}
15801577

15811578
err = decrypt_internal(sk, skb, dest, NULL, darg);
1582-
if (err < 0)
1579+
if (err < 0) {
1580+
if (err == -EBADMSG)
1581+
TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
15831582
return err;
1583+
}
15841584
if (darg->async)
15851585
goto decrypt_next;
15861586

0 commit comments

Comments
 (0)