Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: x-professor@outlook.com
Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
	linux-kernel@vger.kernel.org, corbet@lwn.net,
	skhan@linuxfoundation.org, rdunlap@infradead.org,
	linux-doc@vger.kernel.org, edumazet@kernel.org,
	ncardwell@google.com, gang.yan@linux.dev, kuniyu@google.com,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, matttbe@kernel.org, martineau@kernel.org,
	geliang@kernel.org, ycheng@google.com, weiwan@google.com,
	stable@vger.kernel.org, yangang@kylinos.cn
Subject: Re: [PATCH net v2 1/2] tcp: avoid wrapping Fast Open blackhole timeout
Date: Mon, 16 Nov 2026 05:21:42 +0000	[thread overview]
Message-ID: <179480650221.3133.4194401145263235869@kernel.org> (raw)
In-Reply-To: <072048c5616098a20126342372d66697c728881d.1794672619.git.x-professor@outlook.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The patch adds a new upper bound, `.extra2 = &one_day_secs`
  (86400), to `net.ipv4.tcp_fastopen_blackhole_timeout_sec` in…
- [Low] The commit body of "tcp: avoid wrapping Fast Open blackhole
  timeout" refers to patch revisions: 'In the v1 arithmetic-only test,…

--

tcp: avoid wrapping Fast Open blackhole timeout

This commit computes the Fast Open active-disable interval in
tcp_fastopen_active_should_disable() as a u64 and caps it at
MAX_JIFFY_OFFSET, so the delay can no longer wrap. It also limits
tcp_fastopen_blackhole_timeout_sec to 86400 seconds and documents the new
limit in ip-sysctl.rst.

> This issue was found using a static analysis tool. A loopback reproducer
> induced 12 Fast Open blackholes and waited 1.2 seconds before opening
> another connection. In the v1 arithmetic-only test, the unpatched kernel
> retried active Fast Open, while the fixed kernel used a regular TCP
> handshake. The reproducer required neither kernel modifications nor
> fault injection. The input limit added here rejects that large setting.

[ ... ]

> On the v2 kernel, the sysctl accepts 86400 seconds and rejects 86401,
> leaving the previous value unchanged.

[Severity: Low]
This isn't a bug, but these sentences mention patch revisions (v1 and v2).
Could this revision history go below the --- line instead? Once the patch is
merged, v1 and v2 won't mean anything in git history.

The wording also suggests that the only functional test of the arithmetic
fix (the 6912213 second timeout) was run on v1. The submitted code now
rejects that input, and the only v2 test described is the sysctl range
check.

The arithmetic fix still matters within the new limit. At HZ=1000,
64 * 86400 * 1000 = 5,529,600,000. In 32-bit math that wraps to
1,234,632,704 jiffies, which is about 14.3 days instead of 64 days.

Could the changelog describe a test of the submitted code on that path?

The companion MPTCP patch in this series uses the same v1/v2 wording.

> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index bf193e7ec5168..5bc357e189bde 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -1152,6 +1152,7 @@ static const struct ctl_table ipv4_net_table[] = {
>  		.mode		= 0644,
>  		.proc_handler	= proc_tfo_blackhole_detect_timeout,
>  		.extra1		= SYSCTL_ZERO,
> +		.extra2		= &one_day_secs,
>  	},

[Severity: Medium]
Is this new upper bound needed for the overflow fix? The patch is also
tagged Cc: stable.

proc_tfo_blackhole_detect_timeout() calls proc_dointvec_minmax(), so extra2
is enforced:

net/ipv4/sysctl_net_ipv4.c:proc_tfo_blackhole_detect_timeout() {
    ...
	ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
	if (write && ret == 0)
		atomic_set(&net->ipv4.tfo_active_disable_times, 0);
    ...
}

Before this patch, any non-negative int was accepted, such as 172800 or
604800. Now those writes fail with -EINVAL. The stored value stays as it
was, and the tfo_active_disable_times reset is skipped.

At boot, the stored value is the per-netns default of 0 from tcp_sk_init().
If sysctl.conf has a multi-day value, would Fast Open blackhole detection
stay disabled after a stable update?

The u64 calculation and the cap in tcp_fastopen_active_should_disable()
already seem to handle every int input:

	delay = (u64)multiplier * tfo_bh_timeout * HZ;
	...
		  min(delay, MAX_JIFFY_OFFSET);

tfo_bh_timeout is at most 2^31-1, multiplier is at most 64, and HZ is at
most a little over 1000. The product stays below 2^48, and the cap covers
both 32-bit and 64-bit kernels. So the one day limit looks like a policy
change, not part of the fix.

The commit message mentions the limit. It doesn't say that values accepted
before will now be rejected.

The companion patch in this series, "mptcp: avoid wrapping blackhole
timeout", makes the same arithmetic fix and says "Preserve the existing
sysctl input range". So the two patches treat the input range differently.

Could the bound be dropped here? Or could it move to a separate patch,
without Cc: stable, whose changelog describes the narrower range?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1794672619.git.x-professor%40outlook.com

  reply	other threads:[~2026-11-16  5:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1794672619.git.x-professor@outlook.com>
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 [this message]
2026-11-14 16:12 ` [PATCH net v2 2/2] mptcp: avoid wrapping " Yingjie Wang
2026-11-16  5:21   ` netdev-bot+sashiko

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=179480650221.3133.4194401145263235869@kernel.org \
    --to=netdev-bot+sashiko@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=matttbe@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=stable@vger.kernel.org \
    --cc=weiwan@google.com \
    --cc=x-professor@outlook.com \
    --cc=yangang@kylinos.cn \
    --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