From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0103223C8C7; Thu, 28 May 2026 20:44:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780001099; cv=none; b=AcLCwTDLsM3c8q34vTCsxwngioSdiYf6MSy8+1ip8GWsCBsxR8GCweLW8Se5nrpxVqCKMx/K/0CuHyx5Ma/hf1GR7n6cd88tM9vyMoSBEqcRNRd0id0lX/iK71ivPnhLciD94Wtjc7ObNsnB/F4VxSdGa6I1TBzbT8aAI0swUmA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780001099; c=relaxed/simple; bh=njxvB0QdNzkSNcCUSL6nnTktm2gVIpsIK77SkoaX/Ns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WO3lBgxzoryLyd4UVADl+NOxGoddMGEznJZey1CGVTmENkcz5/6NcOxkHRJs/EfKuQA4LE5ST0nCPYtJf2M0ICUUI7Ryf+h+jGJ0kJOHaVvoA1QgyMEt6m/HbDLd1ZPjKdvJ/Y47HnQrbqT/MHhoCOpYFG3UFaLlcE7gtZ1n/Us= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DXtR77KE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DXtR77KE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FA751F000E9; Thu, 28 May 2026 20:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780001097; bh=0m4/YanCTztW98ammmrrwOcZwPDnoxaUw6R3XJX79WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DXtR77KEzVfELiKeIrE095Wc49TbtiIPxXxDxrYyRDsmx3bYreUPia0hbQSYtntNU SXlCUuY0mTC5BHadrkQWY10S3bG0NBmlV9GUBdRpA9TUCMwmgsSTGa0h19VQil2j0m zOeL/lSS2wBWtGzB2YQc6oyjiee3O5X1UF4GoaOM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Petr Machata , Ido Schimmel , Nikolay Aleksandrov , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 253/272] net: bridge: Flush multicast groups when snooping is disabled Date: Thu, 28 May 2026 21:50:27 +0200 Message-ID: <20260528194636.198051872@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194629.379955525@linuxfoundation.org> References: <20260528194629.379955525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Petr Machata [ Upstream commit 68800bbf583f26f71491141e4b3c8582f9cfcbde ] When forwarding multicast packets, the bridge takes MDB into account when IGMP / MLD snooping is enabled. Currently, when snooping is disabled, the MDB is retained, even though it is not used anymore. At the same time, during the time that snooping is disabled, the IGMP / MLD control packets are obviously ignored, and after the snooping is reenabled, the administrator has to assume it is out of sync. In particular, missed join and leave messages would lead to traffic being forwarded to wrong interfaces. Keeping the MDB entries around thus serves no purpose, and just takes memory. Note also that disabling per-VLAN snooping does actually flush the relevant MDB entries. This patch flushes non-permanent MDB entries as global snooping is disabled. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Link: https://patch.msgid.link/5e992df1bb93b88e19c0ea5819e23b669e3dde5d.1761228273.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski Stable-dep-of: 4df78ff02629 ("bridge: mcast: Fix a possible use-after-free when removing a bridge port") Signed-off-by: Sasha Levin --- net/bridge/br_multicast.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 9bd2914006df7..3d91f5a057509 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -4642,6 +4642,14 @@ static void br_multicast_start_querier(struct net_bridge_mcast *brmctx, rcu_read_unlock(); } +static void br_multicast_del_grps(struct net_bridge *br) +{ + struct net_bridge_port *port; + + list_for_each_entry(port, &br->port_list, list) + __br_multicast_disable_port_ctx(&port->multicast_ctx); +} + int br_multicast_toggle(struct net_bridge *br, unsigned long val, struct netlink_ext_ack *extack) { @@ -4662,6 +4670,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val, br_opt_toggle(br, BROPT_MULTICAST_ENABLED, !!val); if (!br_opt_get(br, BROPT_MULTICAST_ENABLED)) { change_snoopers = true; + br_multicast_del_grps(br); goto unlock; } -- 2.53.0