Netdev List
 help / color / mirror / Atom feed
From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Eric Dumazet <edumazet@kernel.org>, Kyuwon Cho <kyuwoncho18@gmail.com>
Cc: Neal Cardwell <ncardwell@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Cambda Zhu <cambda@linux.alibaba.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [BUG] tcp: shift-out-of-bounds in inet_csk_rto_backoff() for an orphaned zero-window probe
Date: Wed, 18 Nov 2026 20:40:41 +0800	[thread overview]
Message-ID: <8b1622a7-3494-4a0d-8913-c8cf4eae43fc@linux.dev> (raw)
In-Reply-To: <CAL4WiiouZZ46QRp5K6MYK=vevKXYLzd_p049qVVf=w+9L8d96Q@mail.gmail.com>


On 11/18/26 8:12 PM, Eric Dumazet wrote:
> Le mer. 18 nov. 2026 à 11:59, Kyuwon Cho <kyuwoncho18@gmail.com> a écrit :
>> Hi Eric, Neal,
>>
>> While testing v7.4-rc3 with an LLM-guided test generator that we are
>> developing as a research prototype, we found that an orphaned socket
>> that keeps sending zero-window probes makes inet_csk_rto_backoff()
>> shift by 64 or more. An unprivileged user can set this up in its own
>> user and network namespace:
> Thanks for the report and the reproducer.
>
> This is a known issue, a fix is under review:
>
> [PATCH net v2 2/2] tcp: fix shift-out-of-bounds in inet_csk_rto_backoff()
> https://lore.kernel.org/netdev/20261026123244.239766-2-jiayuan.chen@linux.dev/
>
> It limits the shift to 32 in inet_csk_rto_backoff() itself, so it
> covers both callers: tcp_ld_RTO_revert(), which is where Jiayuan hit
> the splat, and the orphan check in tcp_probe_timer() from your report.
>
>> We found no earlier report of this call site.
> Searching lore for the function name would have found it:
>
> https://lore.kernel.org/netdev/?q=inet_csk_rto_backoff
>
> Please do this before sending a report, especially for findings
> coming from automated tools.
>
> Note that the netns sysctls are not needed. tcp_retransmit_timer()
> increments icsk_backoff without any limit, so TCP_USER_TIMEOUT and
> TCP_RTO_MAX_MS on a socket with a silent peer are enough to get
> icsk_backoff above 63, then an ICMP unreachable reaches the shift
> from tcp_ld_RTO_revert().
>
>> On x86 the shift count is masked, so from 64 on alive can come out true
>> again and the orphan keeps probing instead of being aborted.
> Right, and this starts before 64: with icsk_rto == 200, the u64
> is already zero when icsk_backoff reaches 61.
>
> Jiayuan, I have not seen a v3 addressing Neal's feedback.
>
> When you send it, could you please add:
>
> Reported-by: Kyuwon Cho <kyuwoncho18@gmail.com>
> Closes: https://lore.kernel.org/netdev/179499954853.1440581.6627074959099619480@gmail.com/
>
> and mention the zero window probe path in the changelog ?


Sure I can do that.

>
> Kyuwon, it would be nice if you could test Jiayuan's patch with your
> reproducer and send a Tested-by: tag in that thread.
>
> Thanks.

      reply	other threads:[~2026-11-18 12:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 10:59 [BUG] tcp: shift-out-of-bounds in inet_csk_rto_backoff() for an orphaned zero-window probe Kyuwon Cho
2026-11-18 12:12 ` Eric Dumazet
2026-11-18 12:40   ` Jiayuan Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b1622a7-3494-4a0d-8913-c8cf4eae43fc@linux.dev \
    --to=jiayuan.chen@linux.dev \
    --cc=cambda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=kyuwoncho18@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox