Netdev List
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Eric Dumazet <edumazet@kernel.org>,
	Yingjie Wang <x-professor@outlook.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"mptcp@lists.linux.dev" <mptcp@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"rdunlap@infradead.org" <rdunlap@infradead.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"ncardwell@google.com" <ncardwell@google.com>,
	"gang.yan@linux.dev" <gang.yan@linux.dev>,
	"kuniyu@google.com" <kuniyu@google.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"martineau@kernel.org" <martineau@kernel.org>,
	"geliang@kernel.org" <geliang@kernel.org>,
	"ycheng@google.com" <ycheng@google.com>,
	"weiwan@google.com" <weiwan@google.com>
Subject: Re: [PATCH net v2 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound
Date: Mon, 16 Nov 2026 13:29:17 +0100	[thread overview]
Message-ID: <9af16bc6-f44a-4585-8d19-6be3f637a12e@kernel.org> (raw)
In-Reply-To: <CAL4WiirENP_SBccpu3qq51f6u4E7BwFoadEARZctwm0CGNCusg@mail.gmail.com>

Hi Eric, Yingjie,

On 15/11/2026 09:24, Eric Dumazet wrote:
> Le sam. 14 nov. 2026 à 17:12, Yingjie Wang <x-professor@outlook.com> a écrit :
>>
>> The TCP Fast Open and MPTCP blackhole handlers multiply writable timeout
>> sysctl values before adding the result to a jiffies timestamp. The
>> multiplication is performed in 32-bit unsigned arithmetic, so a large
>> value can wrap into a short delay even on a 64-bit kernel.
>>
>> With HZ=1000, a timeout of 6912213 seconds and the maximum multiplier of
>> 64 should produce 442,381,632,000 jiffies, but the current calculations
>> truncate the result to 512 jiffies. Both patches compute the delay in u64
>> and cap it at MAX_JIFFY_OFFSET before adding it to the saved timestamp.
>>
>> The issues were found using a static analysis tool. In the v1 arithmetic
>> A/B tests, loopback reproducers induced 12 blackholes, waited 1.2 seconds,
>> and then made a new connection:
>>
>>   TFO:   base probe 1.026 s, TCPFastOpenActiveFail +1;
>>          fixed probe 0.000 s, TCPFastOpenActiveFail +0.
>>   MPTCP: base probe 3.087 s, MPCapableSYNTXDisabled +0;
>>          fixed probe 0.000 s, MPCapableSYNTXDisabled +1.
>>
>> The TFO counter records another failed active Fast Open attempt. The
>> MPTCP counter records a connection that skips MP_CAPABLE and falls back to
>> TCP while active MPTCP is disabled.
>>
>> Changes since v1:
>>
>> - Add a reasonable upper bound for the TCP Fast Open sysctl, as requested
>>   by Kuniyuki Iwashima. This version proposes one day (86400 seconds),
>>   using the existing IPv4 one_day_secs bound, and documents that limit.
>>   Keep the existing MPTCP sysctl input range.
> 
> The one day limit, the u64 computation and the clamp look fine to me
> for the TCP side: with HZ=1000, 64 * 86400 * HZ still does not fit in
> 32 bits, and 32-bit kernels need the interval to stay below 2^31 jiffies
> for time_before().
> 
> Why is MPTCP left alone? Kuniyuki's remark applies equally to
> net.mptcp.blackhole_timeout: nobody needs a multi-day initial timeout
> there either. I will let MPTCP maintainers decide, but having the two
> sysctls behave differently looks odd.

I agree with Eric: these two "blackhole" sysctl knobs are similar, and
the behaviour shouldn't differentiate then.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


      reply	other threads:[~2026-11-16 12:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 16:12 [PATCH net v2 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound Yingjie Wang
2026-11-14 16:12 ` [PATCH net v2 1/2] tcp: avoid wrapping Fast Open blackhole timeout Yingjie Wang
2026-11-16  5:21   ` netdev-bot+sashiko
2026-11-14 16:12 ` [PATCH net v2 2/2] mptcp: avoid wrapping " Yingjie Wang
2026-11-16  5:21   ` netdev-bot+sashiko
2026-11-15  8:24 ` [PATCH net v2 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound Eric Dumazet
2026-11-16 12:29   ` Matthieu Baerts [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=9af16bc6-f44a-4585-8d19-6be3f637a12e@kernel.org \
    --to=matttbe@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gang.yan@linux.dev \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=weiwan@google.com \
    --cc=x-professor@outlook.com \
    --cc=ycheng@google.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