🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #88

Re: [PATCH net-next v2 3/3] tcp_cubic: fix divide by zero and endless loop on bad module params

#88
From: Jiayuan Chen
Date: Wed, 07 Oct 2026 03:55
24 lines
6838 bytes
On 10/6/26 8:12 AM, Jakub Kicinski wrote:
> On Thu,  1 Oct 2026 19:29:43 +0800 Jiayuan Chen wrote:
>> Subject: [PATCH net-next v2 3/3] tcp_cubic: fix divide by zero and endless loop on bad module params
> if the LLM Medium severity complaint is true maybe also update
> the subject? I thought there's an actual div by zero somewhere
> but the commit msg seems to describe the inf loop



Hi Kuba, sorry for the delay.

The LLM is talking about (cwnd * beta_scale) wrapping, which needs
cwnd >= 33M packets, way past the 1M limit this code documents. So
the loop fix is fine.

The div by zero is real: beta == 1024 in "/ (BICTCP_BETA_SCALE - beta)"
and bic_scale == 0 in do_div(), both at init. The new range check in
this patch rejects both, I just did not say "divide by zero" in the
commit message.

Want me to spell this out in the commit message? I can also add the
READ_ONCE() Eric mentioned in the same respin.
Technical Details
Message-ID: <8a8241c4-0e41-4ddd-aeef-b9ecb4f55d3a@linux.dev>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342221-linux-kernel-netdev=dewy.ru
References: <20261001112948.322463-1-jiayuan.chen@linux.dev> <20261001112948.322463-4-jiayuan.chen@linux.dev> <20261005171227.2014f26e@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342221-linux-kernel-netdev=dewy.ru
From: jiayuan.chen@linux.dev (Jiayuan Chen)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 3/3] tcp_cubic: fix divide by zero and endless
 loop on bad module params
Date: Wed, 7 Oct 2026 11:55:48 +0800
Organization: Usenet Network
Message-ID: <8a8241c4-0e41-4ddd-aeef-b9ecb4f55d3a@linux.dev>
References: <20261001112948.322463-1-jiayuan.chen@linux.dev>
 <20261001112948.322463-4-jiayuan.chen@linux.dev>
 <20261005171227.2014f26e@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="593209"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:27tFu3OAD9C0/muWdNDxdK41YfM= sha256:D/BS1Mv5A+tsRbnojQc1s2sMr8hEwl9mH8Fjt68gtAU=
	sha1:NWriDMiQNLxT2D4yPunDKyI70lw= sha256:cgHm3KuzqQzxmGx3aB7nBjCwr59ZOKgSn1oIdnVJjv8=
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 D953F10F0F6; Wed,  7 Oct 2026 09:50:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.25
X-Spam-Status: No, score=0.25 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	HK_RANDOM_FROM=1, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
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 yWt4tAbXaL6n;
	Wed,  7 Oct 2026 09:50:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342221-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id B797710F0E5; Wed,  7 Oct 2026 09:50:01 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 1C23A28D7A; Wed,  7 Oct 2026 06:50:00 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 60EF23FCB2F;
	Wed,  7 Oct 2026 06:49:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="t8JI/u78"
X-Received: from mta0.migadu.com (out-103.mta0.migadu.com [91.218.175.103])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2EA138B12A
	for <netdev@vger.kernel.org>; Wed,  7 Oct 2026 06:49:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.103
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791355799; cv=none; b=Qk0fBkfSEfITbrm0ZQe+cmG8M/TgXmcN9SUZ+GXE8JSYiy2V4FbDWETZgo+/Xyaz+Ne1qejmbr2obDsivz7k4uqk6EDi/2tUvblhcSMyVKjtVvH2PDF2uEMT9Y8XvSZC8CgVE8pxQNq2vccVnyhPzGBsJEXzOWKMPvkpPyvdlQU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791355799; c=relaxed/simple;
	bh=X2Kii5dEPpIGSKl4rtxnre0C8366Gz5L+2PnSejSm7w=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=hvzWX+ScAvgi3m5VjCSGMUBAHUu6o5ap0LsbiYCx0DjzQqiZHThbeo2G/wXV5VKfiNNJ6alAvwmoN6tHB1AlOkp2sULTJrwviLUwLmHMz5sbOVXKN8psXwfgVG6pWeJIlsBhEGgwnYzLjCVbnBBVazr3P+sAxJSZschbUKnvn0w=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=t8JI/u78; arc=none smtp.client-ip=91.218.175.103
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=X2Kii5dEPpIGSKl4rtxnre0C8366Gz5L+2PnSejSm7w=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1791355795; v=1; x=1791960595;
 b=t8JI/u78TpoM0Yvv5jQnizKrYr/0j5ilyheNdTIdjrzGRbobxnCHTTS/JiHdyKHtE8/tVdDb
 wltJlbUrdmjKpqqX8YCVnj8DSRPBX36EoY6wKVed+gSZge+BuZWAtbu0n/V295TxpmSIuGcFU29
 e95jiYlnk9GXKJ40iL+vY6Ck=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id 12565de92abcb202;
	Wed, 07 Oct 2026 03:56:07 +0000
X-Mizu-Trace-ID: 12565de92abcb202
X-Migadu-Flow: FLOW_OUT
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org, Eric Dumazet <edumazet@kernel.org>,
 Eric Dumazet <edumazet@google.com>, Neal Cardwell <ncardwell@google.com>,
 Kuniyuki Iwashima <kuniyu@google.com>, "David S. Miller"
 <davem@davemloft.net>, Paolo Abeni <pabeni@redhat.com>,
 Simon Horman <horms@kernel.org>,
 Stephen Hemminger <stephen@networkplumber.org>, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261005171227.2014f26e@kernel.org>