summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShahar Shitrit <shshitrit@nvidia.com>2025-10-26 23:03:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-01 13:41:50 +0300
commit6ae0613ea6f54795d7e1d8986e06574fbaff9546 (patch)
tree31a815b72007436f0fa8cd07fb19c7ab3e116199 /include
parent1bc765f0f75a8f7d5e6edda96772d681c536fcf4 (diff)
downloadlinux-6ae0613ea6f54795d7e1d8986e06574fbaff9546.tar.xz
net: tls: Cancel RX async resync request on rcd_delta overflow
[ Upstream commit c15d5c62ab313c19121f10e25d4fec852bd1c40c ] When a netdev issues a RX async resync request for a TLS connection, the TLS module handles it by logging record headers and attempting to match them to the tcp_sn provided by the device. If a match is found, the TLS module approves the tcp_sn for resynchronization. While waiting for a device response, the TLS module also increments rcd_delta each time a new TLS record is received, tracking the distance from the original resync request. However, if the device response is delayed or fails (e.g due to unstable connection and device getting out of tracking, hardware errors, resource exhaustion etc.), the TLS module keeps logging and incrementing, which can lead to a WARN() when rcd_delta exceeds the threshold. To address this, introduce tls_offload_rx_resync_async_request_cancel() to explicitly cancel resync requests when a device response failure is detected. Call this helper also as a final safeguard when rcd_delta crosses its threshold, as reaching this point implies that earlier cancellation did not occur. Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/1761508983-937977-3-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/tls.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/tls.h b/include/net/tls.h
index 6c642ea18050..66527376ca97 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -475,6 +475,12 @@ tls_offload_rx_resync_async_request_end(struct sock *sk, __be32 seq)
}
static inline void
+tls_offload_rx_resync_async_request_cancel(struct tls_offload_resync_async *resync_async)
+{
+ atomic64_set(&resync_async->req, 0);
+}
+
+static inline void
tls_offload_rx_resync_set_type(struct sock *sk, enum tls_offload_sync_type type)
{
struct tls_context *tls_ctx = tls_get_ctx(sk);