mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jiayuan.chen@linux.dev
Cc: netdev@vger.kernel.org, edumazet@kernel.org, edumazet@google.com,
	ncardwell@google.com, kuniyu@google.com, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	stephen@networkplumber.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/3] tcp_hybla: fix divide by zero on rtt0 == 0
Date: Fri, 02 Oct 2026 11:32:35 +0000	[thread overview]
Message-ID: <179094075572.434549.16857994786468388270@kernel.org> (raw)
In-Reply-To: <20261001112948.322463-3-jiayuan.chen@linux.dev>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In net/ipv4/tcp_hybla.c, the patch replaces `module_param(rtt0,
  int, 0644)` with `module_param_cb(rtt0, &rtt0_ops, &rtt0, 0644)`.

--

tcp_hybla: fix divide by zero on rtt0 == 0

This commit changes the rtt0 module parameter from int to unsigned int.
It also registers rtt0 through module_param_cb() with a setter that only
accepts values from 1 to U32_MAX / USEC_PER_MSEC. That stops
hybla_recalc_param() from dividing by zero, and stops rtt0 * USEC_PER_MSEC
from wrapping on 32-bit.

> diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
> index abd7d91807e54..b9b482180d30b 100644
> --- a/net/ipv4/tcp_hybla.c
> +++ b/net/ipv4/tcp_hybla.c
> @@ -26,8 +26,20 @@ struct hybla {

[ ... ]

> +static const struct kernel_param_ops rtt0_ops = {
> +	.set = rtt0_set,
> +	.get = param_get_uint,
> +};
> +
> +module_param_cb(rtt0, &rtt0_ops, &rtt0, 0644);
>  MODULE_PARM_DESC(rtt0, "reference rout trip time (ms)");

[Severity: Low]
Does this drop the parmtype entry for rtt0 from the .modinfo section of
tcp_hybla.ko?

The old module_param() line expanded to module_param_named(), which emits
the type tag:

include/linux/moduleparam.h:
#define module_param_named(name, value, type, perm)			   \
	param_check_##type(name, &(value));				   \
	module_param_cb(name, &param_ops_##type, &value, perm);		   \
	__MODULE_PARM_TYPE(name, #type)

module_param_cb() only expands to __module_param_call():

#define module_param_cb(name, ops, arg, perm)				      \
	__module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0)

MODULE_PARM_DESC(rtt0, ...) is still there, but nothing provides a type.
After this change, modinfo tcp_hybla would show a description for rtt0
with no type suffix.

Since the storage is now unsigned int and it is read back with
param_get_uint, could a line like this be added after module_param_cb()?

__MODULE_PARM_TYPE(rtt0, "uint");

Other module_param_cb() users already do this, for example
arch/x86/kvm/mmu/mmu.c, fs/fuse/inode.c and
drivers/scsi/fcoe/fcoe_transport.c.

>  
>  /* This is called to refresh values for hybla parameters */

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261001112948.322463-1-jiayuan.chen%40linux.dev

  reply	other threads:[~2026-10-02 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 11:29 [PATCH net-next v2 0/3] tcp: fix a few divide-by-zero in congestion control modules Jiayuan Chen
2026-10-01 11:29 ` [PATCH net-next v2 1/3] tcp_bic: fix divide by zero on max_increment == 0 Jiayuan Chen
2026-10-01 11:29 ` [PATCH net-next v2 2/3] tcp_hybla: fix divide by zero on rtt0 " Jiayuan Chen
2026-10-02 11:32   ` netdev-bot+sashiko [this message]
2026-10-01 11:29 ` [PATCH net-next v2 3/3] tcp_cubic: fix divide by zero and endless loop on bad module params Jiayuan Chen
2026-10-01 15:37   ` Eric Dumazet
2026-10-02 11:32   ` netdev-bot+sashiko
2026-10-01 11:33 ` [PATCH net-next v2 0/3] tcp: fix a few divide-by-zero in congestion control modules netdev-bot+sinfo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179094075572.434549.16857994786468388270@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®