๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7484

Re: [PATCH net 4/5] ipv4: restrict igmp_qrv to 255

#7484
From: netdev-bot+sashiko
Date: Mon, 26 Oct 2026 12:15
92 lines
10954 bytes
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.ipv4.igmp_qrv.

Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but even with
  the new cap igmp_qrv still accepts 1..255.

--

ipv4: restrict igmp_qrv to 255

This commit caps net.ipv4.igmp_qrv at U8_MAX. Without the cap, the value
is truncated when it is stored into the u8 in_device::mr_qrv and the u8
crcount/sf_crcount counters. With a value of 256, IGMPv3 state change
records are never sent.

> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index e3760daa34706..ef631a2759b03 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c

[ ... ]

> @@ -978,7 +979,8 @@ static const struct ctl_table ipv4_net_table[] = {
>  		.maxlen		= sizeof(int),
>  		.mode		= 0644,
>  		.proc_handler	= proc_dointvec_minmax,
> -		.extra1		= SYSCTL_ONE
> +		.extra1		= SYSCTL_ONE,
> +		.extra2		= &igmp_qrv_max,

[Severity: Low]
Should Documentation/networking/ip-sysctl.rst be updated as well? With
this patch, a write of 256 or more to net.ipv4.igmp_qrv fails with
-EINVAL, but the igmp_qrv entry still lists only a default and a minimum:

igmp_qrv - INTEGER
	Controls the IGMP query robustness variable (see RFC2236 8.1).

	Default: 2 (as specified by RFC2236 8.1)

	Minimum: 1 (as specified by RFC6636 4.5)

Could a "Maximum: 255" line be added here?

The companion patch "ipv6: restrict mld_qrv to 255" leaves the mld_qrv
entry in the same state.

[Severity: Medium]
This isn't a bug introduced by this patch, but the new cap still allows
values from 8 to 255. Is that enough for the AMT relay?

drivers/net/amt.c writes the sysctl straight into the 3-bit QRV field of
struct igmpv3_query (qrv:3 in include/uapi/linux/igmp.h):

drivers/net/amt.c:amt_build_igmp_gq() {
    ...
	ihv3->qrv	= READ_ONCE(amt->net->ipv4.sysctl_igmp_qrv);
    ...
}

In relay mode, amt_newlink() also copies the same sysctl into amt->qrv:

	if (amt->mode == AMT_MODE_RELAY) {
		amt->qrv = READ_ONCE(amt->net->ipv4.sysctl_igmp_qrv);

amt_build_mld_gq() then writes amt->qrv into the 3-bit MLDv2 field:

	mld2q->mld2q_qrv	= amt->qrv;

Neither path clamps the value or applies the RFC 3376 4.1.6 rule, which
says a robustness variable above 7 is sent as QRV=0.

So with igmp_qrv set to 9 or 10, does the relay send QRV=1 or QRV=2 on
the wire? If so, hosts that follow the querier's QRV would use a lower
robustness value than the one configured.

A fix for this would probably belong in amt.c rather than in the sysctl
bound.

>  	},
>  #endif
>  	{

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261023091419.167088-1-jiayuan.chen%40linux.dev
Technical Details
Message-ID: <179301694367.3134.13593353266190133687@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351881-linux-kernel-netdev=dewy.ru
References: <20261023091419.167088-5-jiayuan.chen@linux.dev>

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-351881-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 4/5] ipv4: restrict igmp_qrv to 255
Date: Mon, 26 Oct 2026 12:15:43 +0000
Organization: Usenet Network
Message-ID: <179301694367.3134.13593353266190133687@kernel.org>
References: <20261023091419.167088-5-jiayuan.chen@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1304810"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:UW0+V0CR28VCPcMC4xuv9eMeoMk= sha256:5TdS3+SUwL8jdUhn+qx9K7j1wrfbVIkv9jPycog+1Dk=
	sha1:l4M2+L8jghRTtfoXxWr6NUTKdKQ= sha256:ep22J4e5rmv69IHyrqfU3xgNklS70t+flD7y0kFAodw=
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 0A165125BA5; Mon, 26 Oct 2026 15:38:54 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.738
X-Spam-Status: No, score=-3.738 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 niEWDtIxzLVm;
	Mon, 26 Oct 2026 15:38:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-351881-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 6D453125BA3; Mon, 26 Oct 2026 15:38:41 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 1B9BA2F6EF; Mon, 26 Oct 2026 12:16:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793016956;
	b=j1GMf5M6vffV4P0XuQ0/uAreE/T7hFsDZZH3SHNn7EpbiiTOa5rsBKkIM24LGdVFomXI
	 Na17kLYjnGmDu7Le1Nzh+PCgvzeePW0ECBc3Om+EoyY6pxnMYhauoQ2BIabPQS0FxrwP5
	 jei07b1bayxabJlL2HyO5jx6gX5FVg/a17YcZ8ehZ9dHqTLTRAS2aZpdnwQpymJEvtG1n
	 XA1P6qRRjgjssN3K6Fw8YtAlOdFFray0qrT1JIr9sZ5oCS1ohDfrUlALNaT2dN7Box1+O
	 0Bni4apEgQish3h1Yrp7Ut7YL7n6Wb14822mo740oUavtvXMF6a+dvz5ICYMh4LOpzw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793016956;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=5oEnd5VlB348VE2PuaggCRhBlkFDc/Vhx4236yvYboQ=;
	b=W0gSAoM9TCIdNcJOz2MFXJUkuMnV/RttvdG5M/vSnwXjE3b/Nr8rt3aTkDxzOwBYmrI7
	 lIsg50F8mB5ZJcf7pfRL9/JMfIqdGw0YtzWO7Q0sImN9Bu33T0nr6Oxx3UfNAc+h9rXcA
	 iwq+RLpU5MxYCha5neWyBq5NN4udplhDzf9GzfDgf77QC2VKzg1Jh3oTpJEuICVv1u1tn
	 Q63oiolAZd82DTvHy8/yrVEpKFKj2CktRplHbOuM5m3OEMohjrgzbPLropzdsgSrZCwmB
	 LCB+fyeFT3L+EKX9bylr3lEEZkfJ9MeCjdOiErYJdUMrcQFcGXTcMBjnbm6kv6mpW9A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OFBqKMwO;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D390960A2604;
	Mon, 26 Oct 2026 12:15:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OFBqKMwO
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793016946;
	b=wG/lH4GK2Vd3qkUT59TdKhQPj8eHoPXLKpRhK4RHdKkS+c6lDbLg/WrEI0NQy/lhuJbX
	 adZSoOZSlfMeVNptCI4K4DV4QOFCmCvi0uT5JOjtJQVt8RcyVEZ1ty+dK+K+UZcmKs0l2
	 zvEsajulvhum3uzhb0p2y/QcTwnNtnxpj1W3oA0X/YvQWcfoY+1Le5GqTkU6rrLAiVgLf
	 TyKL+T77rNigzeIYEs4dCFvE4MYXfwV/hYjMzWCk0a4PaAuBLOZBpm+BAFBlwKe6dtet4
	 znYPSwiBI3hINKsj1LXAU1xInOh93o+KeM83Xkl6x2Xv+9wqBYC9jmJHbeDe6FMHZlw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793016946;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=5oEnd5VlB348VE2PuaggCRhBlkFDc/Vhx4236yvYboQ=;
	b=xHlPfjhNYSN0Pb6L3dMrz8ZEI93RoWY8JgEaSV9hwZwfGssZSFPWHCVCWqe4aIFnMS0l
	 HPOUCexZNf/pzjd70f71nOc6xft+dTeaYuEiq/PTY4gPLLKryVYX7xxL7GwAqqJSCsCb6
	 bVsmYupZ50zBd7faTTKUrFoauverU6oqR/BaSmMSmY8hpoitmtW8rGuLCYpKDjYlSrR2/
	 sEfspX2BDOGWR7mNpjPC4GVrLTlCjZa3AFpm31JrGhi8UZkOa31XhWzC6L/MctPnj5yKr
	 xB4fMRJprcPO+UksaA35wRc0YxQ5NmtYFwI8iiskBNUzKaJ7F6Krpn/AdhPd9YFcL5g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OFBqKMwO;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF3B460A2602;
	Mon, 26 Oct 2026 12:15:45 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E95B1F01829;
	Mon, 26 Oct 2026 12:15:44 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793016945;
	bh=5oEnd5VlB348VE2PuaggCRhBlkFDc/Vhx4236yvYboQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=OFBqKMwO6K5/JCFhdGj4/LYUJYGozZPFdBs+oLmfjhqwHqRiQqOotLV/Iq4n8/sOx
	 SVJnerRkLgpNo2Lr1Rqz7bhPGnNT1GxMKajNMBPUPonZg3Q4F4+iJ6T9yeTtBlni9V
	 wsjawV9fBv7rktXuPbxNqJNvzH81aCh68cWyTc2RXjJi6KL7NPdkmE+uCmigE9wqIH
	 waXgjnedwjUa6jZBMVzL4vGC4eJZga+D22KkfdCX7+bLxNB3RNlW1+RwnJv6AX50xD
	 ZL2o9lJ0MRY75UMwMQejy17oF26Etr/hPCXn4gthfyWC/v77jXsAeeVxGqIU7SgW9K
	 vk5cBK8VpcV0Q==
X-Cc: netdev@vger.kernel.org, stable@vger.kernel.org, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 dsahern@kernel.org, idosch@nvidia.com, kuniyu@google.com,
 joel.granados@kernel.org, chia-yu.chang@nokia-bell-labs.com,
 bronzed_45_vested@icloud.com, yuuchihsu@gmail.com, fmancera@suse.de,
 hannes@stressinduktion.org, fbl@redhat.com, pmladek@suse.com,
 paulmck@kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261023091419.167088-5-jiayuan.chen@linux.dev>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list