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

From: Jiayuan Chen

Date: Wed Oct 07 2026 - 02:49:43 EST



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.