Skip to content
Commit 00240bfa authored by Eric Dumazet's avatar Eric Dumazet Committed by Zhengchao Shao
Browse files

tcp: use signed arithmetic in tcp_rtx_probe0_timed_out()

stable inclusion
from stable-v4.19.318
commit 0fe6516462392ffe355a45a1ada8d264a783430f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAD4B4
CVE: CVE-2024-41007

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0fe6516462392ffe355a45a1ada8d264a783430f



---------------------------

commit 36534d3c54537bf098224a32dc31397793d4594d upstream.

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: e89688e3 ("net: tcp: fix unexcepted socket die when snd_wnd is 0")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Menglong Dong <imagedong@tencent.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Reviewed-by: default avatarJason Xing <kerneljasonxing@gmail.com>
Link: https://lore.kernel.org/r/20240607125652.1472540-1-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent c12bbe85
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment