Re: [PATCH net v3 2/2] tcp: fix shift-out-of-bounds in inet_csk_rto_backoff()

From: Eric Dumazet

Date: Wed Nov 18 2026 - 10:08:29 EST


Le mer. 18 nov. 2026 à 15:43, Jiayuan Chen <jiayuan.chen@xxxxxxxxx> a écrit :
>
> icsk_backoff is used as a shift amount in inet_csk_rto_backoff():
>
> u64 when = (u64)icsk->icsk_rto << icsk->icsk_backoff;
>
> It can go past 63 on the paths of both callers:
>
> - RTO: tcp_retransmit_timer() increments it on every backed-off RTO
> with no cap of its own, then an ICMP unreachable goes through
> tcp_ld_RTO_revert().
> - zero window probe: tcp_send_probe0() increments it up to
> tcp_retries2, and tcp_probe_timer() calls the helper in its orphan
> check. commit 6d4634d1b091 ("net: Limit logical shift left of TCP
> probe0 timeout") clamped tcp_probe0_when() but not this one.
>
> Seen on the RTO path with tcp_retries2=255 and a silent peer:
>

Nit: tcp_retries2 does not need to be changed for the RTO path.
TCP_USER_TIMEOUT and TCP_RTO_MAX_MS on the socket are enough, since
retransmits_timed_out() then only looks at the elapsed time.

No need to respin only for this.

Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>