From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.65 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795771755; b=Mz0UE+dn1RGSA5JVj/y4ecATgPAloUGvgdinWFOiBaw6dg117Wv1TS3n5km9ycP9z/Rt KQKMdfoJJxcThywDQTf6rkwkLGFu3hvunBBd2PIPdLQHyyHf9F62DtPt0Z7bJGRGCF9uO bmI6xiDCL06rGZaKDRyc7Bi2qET5Sm+i7i2bSgeiz3nVOqPkKQI3aQ81WSQKmCGlUGiPT EifdybqcjEv4baeoN8bz3aOY8KfnGYaThsM4rudGZ2W1ODZDMEGjHEzca9zz3VS/jlNcE qx8CssUMLbCpbGmEVTH5r87LJI+KegubMBmeaSQ5NheEfS7fPm03aVymL20xSfyo5hw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795771755; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=5ssYLWCxAfo5jDi/0Ktn+mc8LR1rGP66TW/9Z5LQ1j8=; b=j9X05d0dtPx750zcqCOzBVDg1W3qmrZYDqU1n1HXCoIMAR/05asUhXZo3aunBO2y+fER vdWRwfviLIYFkyL711+DeZA+kvvzSdijXPZThSxZiOWTLtOcrhglJIukFS6qoxWSJNOn+ RVqV+k+Aw+HFpbi2dgTFj8wvOo1q4pnwLPFz7awttrO6ppUQIsCPO675p82G3dTHN6I6m MAyjYgYu+FlM+P/BbJ84pSVg3q6zm20HQUdmdECFcgXFE6WMGwJeglNZqqrYAxwas2Rf2 aTUXBy9sxZjMlEhiBGEOKMaEb75WqlV1N3uXs59UlUcGrtQRtd0nXcSFubrVmakfADg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=RXfaIUa9; arc=none smtp.remote-ip=95.215.58.65 Received: from mta1.migadu.com (out-65.mta1.migadu.com [95.215.58.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A01DB606A33F for ; Fri, 27 Nov 2026 09:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A01DB606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=RXfaIUa9 X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=AAFEebURwC9q020+aAeTJMGbmmnNTHzYTx7bv2ZbPG4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795771752; v=1; x=1796376552; b=RXfaIUa913ZsvutovS0BuZDabtEBFBuIRUOiy+357y3dFu/W3076m/P3Obt2PWJb02qOOu8d T7ZqCPTDUky8xEBRkNdA3VAKfbu9KUxTFk1yiY5ZAUJLmFj7RjM4a2D/xeWaExYrMHSV07/z/f+ Mp5ov6PVX4KmPMJxF1TqmvwM= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 2556b294b86ac472; Fri, 27 Nov 2026 09:29:11 +0000 X-Mizu-Trace-ID: 2556b294b86ac472 X-Migadu-Flow: FLOW_OUT Message-ID: <392d04d6-c6f2-4e55-9b83-afe7fe8f60f3@linux.dev> Date: Fri, 27 Nov 2026 17:28:58 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v4 1/2] tcp: avoid wrapping Fast Open blackhole timeout To: Yingjie Wang , "netdev@vger.kernel.org" Cc: "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" , "joel.granados@kernel.org" References: From: Jiayuan Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/23/26 5:04 PM, Yingjie Wang wrote: > tcp_fastopen_active_should_disable() calculates the active-disable > interval as multiplier * tfo_bh_timeout * HZ. Since all operands are > 32-bit, a large tcp_fastopen_blackhole_timeout_sec can wrap the delay, > even on 64-bit kernels, and re-enable active Fast Open too soon. > > With HZ=1000 and the maximum multiplier of 64, any timeout above 67108 > seconds wraps. For example, 67109 seconds should produce 4,294,976,000 > jiffies (about 50 days), but the calculation truncates it to 8,704 > jiffies (8.7 seconds). > > This issue was found using a static analysis tool. It was confirmed with > a loopback reproducer that induces 12 Fast Open blackholes and opens > another connection 10 seconds later: with a 67109 second timeout, the > unpatched kernel retried active Fast Open. The reproducer needs neither > kernel modifications nor error injection. > > Compute the interval in u64 and cap it at MAX_JIFFY_OFFSET before adding > it to the saved timestamp. On 32-bit kernels, the cap keeps the interval > within the range that time_before() can compare, which limits the longest > backoff there to about 12.4 days at HZ=1000. > > Also limit the writable initial timeout to one day, so the exponential > backoff does not start from an impractically long period. Writes above > 86400 seconds, which were previously accepted, now fail with -EINVAL and > leave the current value unchanged. The wider calculation is still needed > below that limit, as the 67109 second example shows. > > Suggested-by: Kuniyuki Iwashima > Signed-off-by: Yingjie Wang Reviewed-by: Jiayuan Chen