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 C724340963C; Thu, 28 May 2026 20:02:34 +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=1779998556; cv=none; b=CzzIAXj5L5cEpAaYAMlqsQeG6mruXtCPpu1Zf3dcTeXxTuwdES16lloupgqc05HxqCvL2xIuCwdQCGA2JlT1IV4BlXaEFJaPEV/DDcX5Hpbj3h0IXu/PhJPuVa5vi8b0GSkUfAGGlAMSOWVFB1h/X2AMSc9B3CcsZj2qiDv77Ec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998556; c=relaxed/simple; bh=MXmYMv2kBBBf73zdZw3hvB8/G3GAZ86mI6q4PqCyn9A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Abk0IkJXR9KkyYvq+jeLRmaOo9eB/v1CwjpUnPDo9ygg+cN31RiOSoe6+PorBLI/R4mtyriyhVO32wnyWyy/MYcTkXYuVxJj51LK5AQuG+oiHwLY57U7lh7re8GST00Nau3VajZtRecsSwdChyVdESwkLAe++BryBgYVCw4utIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e1zS9ZKt; 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="e1zS9ZKt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F07C1F000E9; Thu, 28 May 2026 20:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779998554; bh=qj8vKEHFmnrYNLbUQmrFjXnVs84aF0OPoD5utgLvRcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e1zS9ZKt3SR2U6jR6biWILzzxXPXJ3qX6VnKLp350SEC6AvfVTtAE6v1oRcdCbAad NDhV2uSa+U+zIJj/UXA+U26a6FK7QD5oER8siyJ8Yg05392LwnhLR1OOEMi/lGfm3u N+LHC1Fmnhyp159/8qcejza7HDvtMu+ZnIeRrH3Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 7.0 215/461] netfilter: bridge: eb_tables: close module init race Date: Thu, 28 May 2026 21:45:44 +0200 Message-ID: <20260528194653.349403687@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194646.819809818@linuxfoundation.org> References: <20260528194646.819809818@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 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal [ Upstream commit 27414ff1b287ea9a2a11675149ec28e05539f3cc ] sashiko reports for unrelated patch: Does the core ebtables initialization in ebtables.c suffer from a similar race? Once nf_register_sockopt() completes, the sockopts are exposed globally. sockopt has to be registered last, just like in ip/ip6/arptables. Fixes: 5b53951cfc85 ("netfilter: ebtables: use net_generic infra") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/bridge/netfilter/ebtables.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 3578ffbc14aee..b9f4daac09af3 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -2583,19 +2583,20 @@ static int __init ebtables_init(void) { int ret; - ret = xt_register_target(&ebt_standard_target); + ret = register_pernet_subsys(&ebt_net_ops); if (ret < 0) return ret; - ret = nf_register_sockopt(&ebt_sockopts); + + ret = xt_register_target(&ebt_standard_target); if (ret < 0) { - xt_unregister_target(&ebt_standard_target); + unregister_pernet_subsys(&ebt_net_ops); return ret; } - ret = register_pernet_subsys(&ebt_net_ops); + ret = nf_register_sockopt(&ebt_sockopts); if (ret < 0) { - nf_unregister_sockopt(&ebt_sockopts); xt_unregister_target(&ebt_standard_target); + unregister_pernet_subsys(&ebt_net_ops); return ret; } -- 2.53.0