]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tcp: make probe0 timer handle expired user timeout
authorAltan Hacigumus <ahacigu.linux@gmail.com>
Fri, 24 Apr 2026 01:46:38 +0000 (18:46 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 28 Apr 2026 02:16:07 +0000 (19:16 -0700)
commit2b9f6f7065d4cfb65ba19126e0b35ac4544c3f3a
treecbdd30643e24bbbea490bb652cffa18874c0344e
parentcc427d24ac6442ffdeafd157a63c7c5b73ed4de4
tcp: make probe0 timer handle expired user timeout

tcp_clamp_probe0_to_user_timeout() computes remaining time in jiffies
using subtraction with an unsigned lvalue.  If elapsed probing time
exceeds the configured TCP_USER_TIMEOUT, the underflow yields a large
value.

This ends up re-arming the probe timer for a full backoff interval
instead of expiring immediately, delaying connection teardown beyond
the configured timeout.

Fix this by preventing underflow so user-set timeout expiration is
handled correctly without extending the probe timer.

Fixes: 344db93ae3ee ("tcp: make TCP_USER_TIMEOUT accurate for zero window probes")
Link: https://lore.kernel.org/r/20260414013634.43997-1-ahacigu.linux@gmail.com
Signed-off-by: Altan Hacigumus <ahacigu.linux@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260424014639.54110-1-ahacigu.linux@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_timer.c