Article View: linux.kernel.netdev
Article #9428Re: [PATCH net v3 4/5] ipv4: restrict igmp_qrv to 255
From: Hangbin Liu
Date: Mon, 02 Nov 2026 01:29
Date: Mon, 02 Nov 2026 01:29
95 lines
13331 bytes
13331 bytes
On Sun, Nov 01, 2026 at 02:12:02PM +0800, Jiayuan Chen wrote:
> net.ipv4.igmp_qrv only has a lower bound, but ip_mc_reset() stores it
> into the u8 in_device::mr_qrv, and the IGMPv3 retransmit counters filled
> from it (crcount, sf_crcount) are u8 as well. Anything above 255
> silently wraps. With 256, mr_qrv becomes 0, every
> "in_dev->mr_qrv ?: sysctl_igmp_qrv" falls back to 256, which truncates
> to 0 again in crcount, and igmpv3_send_cr() never puts the state change
> records for the group into a report. The older version querier present
> timeout (mr_qrv * mr_qi + mr_qri) also collapses to just mr_qri.
>
> Make the sysctl a u8 like mr_qrv and switch to proc_dou8vec_minmax(),
> which rejects anything above 255, and document it.
>
> Fixes: a9fe8e29945d ("ipv4: implement igmp_qrv sysctl to tune igmp robustness variable")
> Cc: stable@vger.kernel.org
> Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> ---
> For AI review: drivers/net/amt.c writing sysctl_igmp_qrv into the 3-bit
> qrv wire fields is pre-existing and out of scope for this patch.
>
> v2: switched to u8 and proc_dou8vec_minmax(), as suggested by Kuniyuki
> Iwashima.
> ---
> Documentation/networking/ip-sysctl.rst | 2 ++
> Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst | 2 +-
> include/net/netns/ipv4.h | 2 +-
> net/ipv4/sysctl_net_ipv4.c | 4 ++--
> 4 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst
> index 71f334f27004e..9e282fb046904 100644
> --- a/Documentation/networking/ip-sysctl.rst
> +++ b/Documentation/networking/ip-sysctl.rst
> @@ -1906,6 +1906,8 @@ igmp_qrv - INTEGER
>
> Minimum: 1 (as specified by RFC6636 4.5)
>
> + Maximum: 255
> +
> force_igmp_version - INTEGER
> - 0 - (default) No enforcement of a IGMP version, IGMPv1/v2 fallback
> allowed. Will back to IGMPv3 mode again if all IGMPv1/v2 Querier
> diff --git a/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst b/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst
> index 3dc03bff739e4..2833ce6cba1d4 100644
> --- a/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst
> +++ b/Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst
> @@ -143,9 +143,9 @@ int sysctl_udp_rmem_min
> u8 sysctl_fib_notify_on_flag_change
> u8 sysctl_udp_l3mdev_accept
> u8 sysctl_igmp_llm_reports
> +u8 sysctl_igmp_qrv
> int sysctl_igmp_max_memberships
> int sysctl_igmp_max_msf
> -int sysctl_igmp_qrv
> struct_ping_group_range ping_group_range
> atomic_t dev_addr_genid
> unsigned_int sysctl_udp_child_hash_entries
> diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
> index cb7f8bf15671c..3efbc7f4b4f7d 100644
> --- a/include/net/netns/ipv4.h
> +++ b/include/net/netns/ipv4.h
> @@ -258,9 +258,9 @@ struct netns_ipv4 {
> #endif
>
> u8 sysctl_igmp_llm_reports;
> + u8 sysctl_igmp_qrv;
> int sysctl_igmp_max_memberships;
> int sysctl_igmp_max_msf;
> - int sysctl_igmp_qrv;
>
> struct ping_group_range ping_group_range;
> u16 ping_port_rover;
> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index e3760daa34706..09f7fc6771456 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -975,9 +975,9 @@ static const struct ctl_table ipv4_net_table[] = {
> {
> .procname = "igmp_qrv",
> .data = &init_net.ipv4.sysctl_igmp_qrv,
> - .maxlen = sizeof(int),
> + .maxlen = sizeof(u8),
> .mode = 0644,
> - .proc_handler = proc_dointvec_minmax,
> + .proc_handler = proc_dou8vec_minmax,
> .extra1 = SYSCTL_ONE
> },
> #endif
> --
> 2.43.0
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID:
<aufnh3qqed0uFdfe@fedora>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354418-linux-kernel-netdev=dewy.ruReferences:
<20261101061331.286404-1-jiayuan.chen@linux.dev> <20261101061331.286404-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-354418-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 4/5] ipv4: restrict igmp_qrv to 255 Date: Mon, 2 Nov 2026 09:29:43 +0800 Organization: Usenet Network Message-ID: <aufnh3qqed0uFdfe@fedora> References: <20261101061331.286404-1-jiayuan.chen@linux.dev> <20261101061331.286404-5-jiayuan.chen@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2819631"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:1DWS+kiSlrbnXghKdfDfZLVl70w= sha256:CZB2t2trzY4SZyCMCN/MGGFlkAed0Fuf3P8SgG8ps+s= sha1:BjShhK/Mkq7otGvJFq1PGhlsCkA= sha256:X+4YAtOmJ2yItj3AFrw0t4FkntMfwz4RlJafWtcl5Yc= Content-Disposition: inline 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 21EA51123F2; Mon, 2 Nov 2026 04:30:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham 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 zZs7lusozPfs; Mon, 2 Nov 2026 04:30:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-354418-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 9CCBD1122D2; Mon, 2 Nov 2026 04:30:04 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id B0CF66048D1; Mon, 2 Nov 2026 01:30:03 +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=1793583003; b=1+LK/eyI8stZlTeKynnSdLHXXWJx6C3tTR5XR80BY1PBoKeKh1+7JfjmhcTafbUYPe6p zwa2hBslWa6YrS0xoEXLAhIrxpNL5qwJszoem1pniBK1dL4jlbpV8HeBxzVjQBz95YwXs VPuRZ7L6i4vTYgl0wBBWkrSngtLDW9nFHkES+Gaa9nM2y9aMOkdKIKf1+iQTiJNhLgvvS DYBa3HfQ3OOIxCRK/n+n1vO2AEew0A2hsToJk1AjksbCwqQTlhxbkciwhYLsqjPr48mEL hKl3HRenFwy+LXDCjylIlQGARaQWCoXZWBTWbi4K+zghE7XYRad3uOlNmpD1Tea1pKA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793583003; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=kobs1iufd5VuuAjIqrJ+M9JQH6AjaOqsgHCe2QQeXSA=; b=L1YJTDOHZo5hA11TM9h2p7vF0UWqfYT6ijEzP3Ms9SXVNqAxlufr50iNU8Fg1VJNISdY Z6waE7sbfBCOslNKHKrMsQ7qMjlETkxBDdRx2yUNnq7O2pekchJt0H3q2i6MLRCFria7s +dNCmn2Z1ONfOzEI1WpUr9DNuvYQJ3e0NNZkFXOB0f5TjChgn5H5FaYpNGbLwzEOO7pBA 6raZ68gaWfUQN8knQpWNEo06Mg5L/6s3hnLkjtxAd+mHzF8kcetRuHxT7Oq44A6ZnPS9k 04c5HhIlFsnLJReJXGL/xxwu/pwfEj52WNnmwFyBZH0X+RJqTZ/RWNp6cDI0Chcv4hA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Y+ygUMwl; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 53006606A333; Mon, 2 Nov 2026 01:30:03 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Y+ygUMwl X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.129 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793583002; b=WGqPoA9APc27xbmFQ/hvQY0URufvzfBKi1h3dRiSujPTmo/+12msJ80bKNC276zL+TJm pl2LDvOzxvH6gl7ZBuJTkL+97ch+NJ2ac9tAkDQU9NdgMLUjPGbxALA9JpG2vjl/c/cLl Onn/38A63HoA077NGt57lF/yuwove78HgoOE/l4EaQmQUas4cHNTPVJdDxmnlzWt/besJ +1nfVtGMTsLLiETex+aaf1RAyF9cu8AGVfkv0fUW29c51lYRuqIuth5vTwQS6L81mU211 0GpRxBsHU6fWuTVPv2i4WF3kW/wlOzWjxQO/mzgBkY2tRbb+GQmSfNAbjo7DiCnhSqQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793583002; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=kobs1iufd5VuuAjIqrJ+M9JQH6AjaOqsgHCe2QQeXSA=; b=C/3huod2N3fTJerEVk5Bsr2oZiH/Zxkl3e3H2+9ct6b0C9QWN8bvurt/KIrXE69sZiCO NCxxzU1ybDnsHHnsobmYKbrQp/p0Nfm1UG77ZCJM9Rcf8h17P/grmjaxteQRjb9Lo+YB8 IAUzYhzySwGrCZ226n5MqNKvm1hn0XgukKduy9+8+F/adi6eIEhbuRFDNFCgJv1q/u3aV RMGhM+woGjPxeF9rT3Tdh3eBa9u4LtNyEjyWKaUO3esjTSQw8EQw1YtRXwnQD9untK93R ycjrCTetDdSu5eohQ2VrzlMYskff4OJXQXyW0VNuA2+f3iv5TfMy8fyg2/h5hT20J8g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Y+ygUMwl; arc=none smtp.remote-ip=95.215.58.129 X-Received: from mta1.migadu.com (out-129.mta1.migadu.com [95.215.58.129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C882A606A32C for <netdev@vger.kernel.org>; Mon, 2 Nov 2026 01:30:01 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C882A606A32C 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=s/F8VxgW4pEwEvLpz2+yms9bPqiVecWY5EikSvOOQsA=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793583000; v=1; x=1794187800; b=Y+ygUMwlqsBzApa0Pe2og5jhWMDu73EArPrXZFiawNlhZjhN2bUxCJDiKt1oBcoxKwxCkgJP Cg0N6U4LQxktv/Reeer+HqH6VgzOgUEF6tJoKPs/6y8aMucC5imzfw67WT/0b/t6NIPDQL4yVmh zFpSBA/H0sSttGaed8C4A23w= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id f8a2442e0be9f11c; Mon, 02 Nov 2026 01:29:59 +0000 X-Mizu-Trace-ID: f8a2442e0be9f11c X-Migadu-Flow: FLOW_OUT X-Cc: netdev@vger.kernel.org, stable@vger.kernel.org, Fernando Fernandez Mancera <fmancera@suse.de>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>, Shuah Khan <skhan@linuxfoundation.org>, Randy Dunlap <rdunlap@infradead.org>, David Ahern <dsahern@kernel.org>, Ido Schimmel <idosch@nvidia.com>, Joel Granados <joel.granados@kernel.org>, Thomas Gleixner <tglx@kernel.org>, Petr Pavlu <petr.pavlu@suse.com>, Kuniyuki Iwashima <kuniyu@google.com>, Maoyi Xie <maoyi.xie@ntu.edu.sg>, Jiri Wiesner <jwiesner@suse.de>, Oleg Nesterov <oleg@redhat.com>, Gerd Rausch <gerd.rausch@oracle.com>, Neal Cardwell <ncardwell@google.com>, Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>, Yung Chih Su <yuuchihsu@gmail.com>, Wyatt Feng <bronzed_45_vested@icloud.com>, Hannes Frederic Sowa <hannes@stressinduktion.org>, Flavio Leitner <fbl@redhat.com>, "Paul E. McKenney" <paulmck@kernel.org>, Petr Mladek <pmladek@suse.com>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org 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 X-In-Reply-To: <20261101061331.286404-5-jiayuan.chen@linux.dev>