Re: [PATCH net 3/5] ipv6: restrict mld_qrv to 255
From: netdev-bot+sashiko
Date: Mon Oct 26 2026 - 08:21:54 EST
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] This patch adds an upper bound to net.ipv6.mld_qrv in
net/ipv6/sysctl_net_ipv6.c: `static int mld_qrv_max = U8_MAX;` at line…
--
ipv6: restrict mld_qrv to 255
This commit adds an upper bound of U8_MAX to the net.ipv6.mld_qrv
sysctl. ipv6_mc_reset() stores the value in the u8 inet6_dev::mc_qrv, so
larger values wrap. A value of 256 wraps to 0, which then trips the
WARN_ON() in mld_update_qrv() when an MLDv2 query arrives.
> diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
> index 1a0a36dcdabc1..05a3846803322 100644
> --- a/net/ipv6/sysctl_net_ipv6.c
> +++ b/net/ipv6/sysctl_net_ipv6.c
[ ... ]
> @@ -229,7 +230,8 @@ static struct ctl_table ipv6_rotable[] = {
> .maxlen = sizeof(int),
> .mode = 0644,
> .proc_handler = proc_dointvec_minmax,
> - .extra1 = SYSCTL_ONE
> + .extra1 = SYSCTL_ONE,
> + .extra2 = &mld_qrv_max,
> },
[Severity: Low]
This isn't a bug, but should Documentation/networking/ip-sysctl.rst be
updated to match? The mld_qrv entry there already lists its lower limit,
but it doesn't mention the new maximum:
mld_qrv - INTEGER
Controls the MLD query robustness variable (see RFC3810 9.1).
Default: 2 (as specified by RFC3810 9.1)
Minimum: 1 (as specified by RFC6636 4.5)
With extra2 set to &mld_qrv_max, proc_dointvec_minmax() now rejects
writes above 255 with -EINVAL. Writes such as 256 or 1000 used to be
accepted.
Could a "Maximum: 255" line be added, maybe with a short note that the
value is stored in a u8?
No later patch in the series seems to update this file. The igmp_qrv
entry in ip-sysctl.rst also still lists only a minimum, even though
igmp_qrv also appears to be capped at 255 by the end of the series.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261023091419.167088-1-jiayuan.chen%40linux.dev