๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17144

Re: [PATCH net v2 0/2] tcp/mptcp: prevent blackhole timeout arithmetic wraparound

#17144
From: Matthieu Baerts
Date: Mon, 16 Nov 2026 12:29
53 lines
14089 bytes
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.
Technical Details
Message-ID: <9af16bc6-f44a-4585-8d19-6be3f637a12e@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364303-linux-kernel-netdev=dewy.ru
References: <cover.1794672619.git.x-professor@outlook.com> <CAL4WiirENP_SBccpu3qq51f6u4E7BwFoadEARZctwm0CGNCusg@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364303-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org (Matthieu Baerts)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 0/2] tcp/mptcp: prevent blackhole timeout
 arithmetic wraparound
Date: Mon, 16 Nov 2026 13:29:17 +0100
Organization: Usenet Network
Message-ID: <9af16bc6-f44a-4585-8d19-6be3f637a12e@kernel.org>
References: <cover.1794672619.git.x-professor@outlook.com>
 <CAL4WiirENP_SBccpu3qq51f6u4E7BwFoadEARZctwm0CGNCusg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2060384"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:F6+0Ls8vOxyswyRCGukNWKMVEWg= sha256:wZNMXQLrUN5HFtCCeJjxxKFMRFrk5SS+JWEkzQQ11rI=
	sha1:xujbPUpshCAl5FbrzzKT9ql8sPw= sha256:Q8udg1HUntS14bdx6hiOFocXPwb9CP48vxQMqzXNbPM=
Content-Language: fr
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id D0C48114C04; Mon, 16 Nov 2026 15:29:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id WT2UPtWcgoYh;
	Mon, 16 Nov 2026 15:29:41 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364303-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 92147114BEF; Mon, 16 Nov 2026 15:29:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 3EACC2B3CA; Mon, 16 Nov 2026 12:29:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794832167;
	b=TZnbh1sPY6PSHBdt0QbBRTLU6lUoBIrcS8viph+TG6rNR+oEZKf6HJ/u6mKxw33cgJ1c
	 Xub8AjZ4tr/tPUfp9Hv74FC/ptfmP+4N+DFkBXQEpsAFA6XJZ/jiKdAdqx/5ssOXADkez
	 HpPqk2tnhSc5XeU+br6TeSwgrqZJcrGI3u2Rjfho5uZo/mfvUKS+fTXmkqSNdU7Q0HQ8r
	 5HBKWJHddb7T17Aw58135+EJXfiYouXXxHUJETmgSUzpBhFFKGD8uralBCPrefgnpXFbq
	 1gWHuNxHYwJq3KLgourXU+dSUXgbGug1xu4OrqqYhNWIaCzEJzlBkGcx8aeLyDLomgA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794832167;
	h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:Autocrypt:Organization:
	 In-Reply-To:Content-Type:Content-Transfer-Encoding;
	bh=8lfPLp5TsXisntpYB62MidRhzh2xJrWLldHNeL5CnQ0=;
	b=oAYBX90bUq3g+PbeeJIWKkxwsdDxqSoHIOhLnmgVH04uI09AwhV1lAjxikrbVlXO7oIb
	 J6HfJb9lcssDEpZf4OBcuagvoGOWrFryrlZCDYBurG7eLMdioBya8QqzHwxz5D90JTVlF
	 C/m7/UGbrq2+R51KD4Ig/4uTkz3MgKn0NMXTvObtVT3anb8WnwHK7dsadbcb6jpXAtOV2
	 +zqau/5nfrCIePgLhw5VxA73ksdTLJe0q6E2G7RtU9Vcdbe72aIbvQfq5FxnSQoh+6KRe
	 06GDBmNb9inW6iJyPj0KEhVvCM20wLPioW1c07SXDjAo9Z1YbIquJ2oNzLrkalZzRKg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UE+d2nl1;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id EBD3C606A339;
	Mon, 16 Nov 2026 12:29:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UE+d2nl1
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794832166;
	b=C6GHegEWJdphTI4FsM8x2andEdd/kAPZq7F2j8UNuXDzvJ9movyi1OqUihb7BHHmosTC
	 Gb6xZF2bzYnGzNkUwY57E8zla9/tjWrEW6DbvHNS08Z7YwuYxefykiWzzi6t5ILSoBHyr
	 f7xIgxaqGjzvdacPTbFWUcs02qVa7PK/xXS7l801B+L0poOr46c/3Yc4R80myjNnVxmK6
	 TlL0MW8NIjnxtwvjYS1QBmXZy7TsgsNs6GsYmQYJSqHoUxq9wkC47HeXI5pZbwkMdGnkG
	 VGYSNcylBdv/xml2Khq5Yd49iObEoe1do0IGdxhXZQ2CE7gvhxSawdbxTCfiq+S/ozg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794832166;
	h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:Autocrypt:Organization:
	 In-Reply-To:Content-Type:Content-Transfer-Encoding;
	bh=8lfPLp5TsXisntpYB62MidRhzh2xJrWLldHNeL5CnQ0=;
	b=fnW3vG80xqYyyS2iylLh2mxyxfgFDB2Jh7ZZHT4oQ6YxcE4+MiLz/dKhWjMjDIJsK0/1
	 gtsxjTzc40XF0nt9uXLVDR3rrltMTKa5GgMHO2ugNcqESlruHeCEPfnXwn/5E7Fqoz6HO
	 C6j+WOhhm+KcMTr8df3Cn/ylZKdEFdw02fFWQztuZB2AonXg3Mr4klpQdh2DHo5tfeOJe
	 7UwYEinaG98GBnlsrRLtaVSqJkAJuMayL3hkCZv+EHQrvpK+1mbwRDJMNoMESredN+v94
	 /2yhNZ7khgtOL0qa8r/QdhwYonoZW2rceAhg18foa6MteL9p5Iqwh7ItuildPQcigZw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UE+d2nl1;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14089606A31C;
	Mon, 16 Nov 2026 12:29:25 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F7891F000C4;
	Mon, 16 Nov 2026 12:29:21 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794832165;
	bh=8lfPLp5TsXisntpYB62MidRhzh2xJrWLldHNeL5CnQ0=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=UE+d2nl1xi6laQEmxqVBp1nbZvKivGZcX3T+WcUMQEyhPX9vydA/kPqnjWR7x4o8S
	 6FbvMdQm89jWMAJaXEOMlaXP9U32npYEzs58NCczfW06r67tMRnHsC7ugrJQTVEyp3
	 MGAx9AXzTGBbh6O1Fbf9TbqUkpgios7I7QK4RGZCI+AYhfzQjIvKik9eKIIOi4VG/e
	 Pj2kD5TLt7Oi7S8Wef289Pj2nGM5ACzT1uQKIvlLb27AlYnzUP9sP6PpUi42va2Fbr
	 TybgYldR63kCqaF9SVJ14lUVxJaqs0syNdKyKpR2dh0Dwt7hpi6u9WXGOpPUUclBgo
	 qgrFA/QtkAaXw==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird Beta
X-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>
X-Autocrypt: addr=matttbe@kernel.org; keydata=
 xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf
 YBNdx5Xl74NLSgx6y/1NiMQG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