From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.33 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792746985; b=fTMSjjw/9Beum8SnouHAFVlfI0/15HQ6no7ueGVXG3tmsXVJFO5DVdqMeexft7NKewhT MnLqC4q01Bfy7ibiCc/RC//1ux5DgzjzKD41Wh3gL8BDemEbuN4hHCJRrY4OctqnlWCCR 2JtlB4Nh5eatSZOv/7GZvuHZjXRIoIlnowbBkT2z1cbKbRClS2nEm0shWDMqSzGCzOR9Q BvxB+e+aUIna4aNR7tLXGTAqXb2LRB4Dcz+Joi/x1J4WJB1838Cym45P07Yf6u7YrqyIt H2s//8uUrwXQb6Zxp4aczsbwDIxDr+r5xCwWq8fQHflPlAUHHcdlXUpDGb0t508MFpg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792746985; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=oBI4N91izr3cJn6kY+KTMO5nPi5tQd2NZvpOi2lFG5M=; b=i6w1TB4/Fu62wWTaOwX2tm9e26ig7Q16HnEcgu0MRmyVJe5l1G4Xwg+pVp7d9TgVzG7V AhTTUNfChXuo6qRLBdeUwzz881Ddna257U+w6F4WIRXRePzyaCRVzJnnVDmBsDE2pCIBq 4FqAZrisE7gTFlk+1qoM5gMmPiYe0/RA461aKIzCukB83o1OHN5hmfeHDa0DmUtbOZ2lr muhh4gle47YeCX7U5/GcYt7jxNAf8sDO670jToShdW2354L8fd6lPE5pnzPsswjoCilOl PQBvl6ovotFdT3AL9XH+pD+i8qTlIP2uzD/Qo5/lI+RTvsl4bBg8JFft3HJsaR0Vy3g== 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=R4baXqCd; arc=none smtp.remote-ip=91.218.175.33 Received: from mta0.migadu.com (out-33.mta0.migadu.com [91.218.175.33]) (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 C2B05606A31E for ; Fri, 23 Oct 2026 09:16:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C2B05606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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=R4baXqCd X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=X9TM650OebmRwJLsuG71hTCuTdvOT1LW5J7WGLHQn1Y=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1792746983; v=1; x=1793351783; b=R4baXqCd+baNkD6G9BEMpwbrLyzo2JndASVbQPkuQ3YV8IXYThjngIj+6P1cIu/7sz/S8Z/S VGp03pcUDCYj8EtXgD5MkmIxyYSp5f+vkfXO14U1SeuR2kqepvamEmIfj8jzkASsq9UmCn3kbow vGt77s5DhVww1a3ktgIM3WNc= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 43f3da9f26efb15e; Fri, 23 Oct 2026 09:16:22 +0000 X-Mizu-Trace-ID: 43f3da9f26efb15e X-Migadu-Flow: FLOW_OUT From: Jiayuan Chen To: netdev@vger.kernel.org Cc: Jiayuan Chen , stable@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Ido Schimmel , Kuniyuki Iwashima , Joel Granados , Chia-Yu Chang , Wyatt Feng , Fernando Fernandez Mancera , Yung Chih Su , Hannes Frederic Sowa , Flavio Leitner , Petr Mladek , "Paul E. McKenney" , linux-kernel@vger.kernel.org Subject: [PATCH net 4/5] ipv4: restrict igmp_qrv to 255 Date: Fri, 23 Oct 2026 17:13:30 +0800 Message-ID: <20261023091419.167088-5-jiayuan.chen@linux.dev> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261023091419.167088-1-jiayuan.chen@linux.dev> References: <20261023091419.167088-1-jiayuan.chen@linux.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Unlike MLD there is no WARN_ON() here, the reports just go missing. Cap the sysctl at U8_MAX, the largest value mr_qrv can actually hold. Fixes: a9fe8e29945d ("ipv4: implement igmp_qrv sysctl to tune igmp robustness variable") Cc: stable@vger.kernel.org Signed-off-by: Jiayuan Chen --- net/ipv4/sysctl_net_ipv4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index e3760daa3470..ef631a2759b0 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -33,6 +33,7 @@ static int ip_privileged_port_min; static int ip_privileged_port_max = 65535; static int ip_ttl_min = 1; static int ip_ttl_max = 255; +static int igmp_qrv_max __maybe_unused = U8_MAX; static int tcp_syn_retries_min = 1; static int tcp_syn_retries_max = MAX_TCP_SYNCNT; static int tcp_syn_linear_timeouts_max = MAX_TCP_SYNCNT; @@ -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, }, #endif { -- 2.43.0