]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tcp: use signed arithmetic in tcp_rtx_probe0_timed_out()
authorEric Dumazet <edumazet@google.com>
Fri, 7 Jun 2024 12:56:52 +0000 (12:56 +0000)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Fri, 2 Aug 2024 14:27:06 +0000 (16:27 +0200)
commita0d8cdaa7b834973ab256c3251252389303bc5b8
tree1ec12253351540f5f7eae79191de146b931b2a09
parentb5eb5f7f50b7c1623317adaca2d482a2ff5caf87
tcp: use signed arithmetic in tcp_rtx_probe0_timed_out()

BugLink: https://bugs.launchpad.net/bugs/2074091
[ Upstream commit 36534d3c54537bf098224a32dc31397793d4594d ]

Due to timer wheel implementation, a timer will usually fire
after its schedule.

For instance, for HZ=1000, a timeout between 512ms and 4s
has a granularity of 64ms.
For this range of values, the extra delay could be up to 63ms.

For TCP, this means that tp->rcv_tstamp may be after
inet_csk(sk)->icsk_timeout whenever the timer interrupt
finally triggers, if one packet came during the extra delay.

We need to make sure tcp_rtx_probe0_timed_out() handles this case.

Fixes: e89688e3e978 ("net: tcp: fix unexcepted socket die when snd_wnd is 0")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Menglong Dong <imagedong@tencent.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://lore.kernel.org/r/20240607125652.1472540-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
net/ipv4/tcp_timer.c