net.mptcp.blackhole_timeout accepts any non-negative int as the initial period for disabling active MPTCP after a blackhole, and the period can then grow 64-fold. A multi-day initial period is not useful, and on 32-bit kernels, values above about 1,073,741 seconds at HZ=1000 are shortened by the MAX_JIFFY_OFFSET cap even on the first blackhole. Limit the writable value to one day, matching net.ipv4.tcp_fastopen_blackhole_timeout_sec, and document the limit. The default of 3600 seconds is unchanged. Writes above 86400 seconds, which were previously accepted, now fail with -EINVAL and leave the current value unchanged. Suggested-by: Eric Dumazet Signed-off-by: Yingjie Wang --- Documentation/networking/mptcp-sysctl.rst | 1 + net/mptcp/ctrl.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Documentation/networking/mptcp-sysctl.rst b/Documentation/networking/mptcp-sysctl.rst index b9b5f58e0625..ca00253c8ae9 100644 --- a/Documentation/networking/mptcp-sysctl.rst +++ b/Documentation/networking/mptcp-sysctl.rst @@ -63,6 +63,7 @@ blackhole_timeout - INTEGER (seconds) blackhole issue goes away. 0 to disable the blackhole detection. This is a per-namespace sysctl. + The maximum value is one day (86400 seconds). Default: 3600 diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c index 0b10e94e7f43..1f167f72c1f5 100644 --- a/net/mptcp/ctrl.c +++ b/net/mptcp/ctrl.c @@ -20,6 +20,7 @@ static int mptcp_pernet_id; #ifdef CONFIG_SYSCTL static int mptcp_pm_type_max = __MPTCP_PM_TYPE_MAX; +static int mptcp_blackhole_timeout_max = 24 * 3600; #endif struct mptcp_pernet { @@ -350,6 +351,7 @@ static struct ctl_table mptcp_sysctl_table[] = { .mode = 0644, .proc_handler = proc_blackhole_detect_timeout, .extra1 = SYSCTL_ZERO, + .extra2 = &mptcp_blackhole_timeout_max, }, { .procname = "syn_retrans_before_tcp_fallback", -- 2.43.0