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 5CDC43002A0; Thu, 28 May 2026 20:23:40 +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=1779999821; cv=none; b=ST2LvlIzNZ/Yoi1vNB7k+T2VG37MjD3J+7pQMvYDhDhORMyNXcENZZvtcId77NAIGw1KzcxKeZuWHl+R/H4QYEjk8HLS81umgAddoH0VlqaAci0sZZAIUtuqFEVAlQL+XOKSuuhNlmXA/o01JcIlMkyMT2mndMDAXDWnusPqQT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999821; c=relaxed/simple; bh=Bz196BIjO+gQ+gKbFqg3dRse0BKLn6OK/Z8xeOFhZf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TZvv07gd9T6yfE/lv/gsIswJ3XHySft5gJ164v/1x8fIeN0ht0G/MSfA8IXFdCo6sktWPokxYfL66xYR+3JKpOGcd8+WZLZeBDQoiAElg5J1MovTh6FdoW/PCNoCdzLdC96O26m+8Ga4T73kz5dmtkhOaSib3U5M6c6AHFCJDko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HxlYtPj6; 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="HxlYtPj6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAE5C1F000E9; Thu, 28 May 2026 20:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779999820; bh=qjhOjdpsCyOzSCOvKy1K07guXZQHms0RuWQOh6dsmNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HxlYtPj62otiamOsHALILWIjDiiG4infLlAzEm7D5sHoJAPG3ro/Ji8nXYKONmkDX swNFbWf4o/5/XW0K1QYE4qxjlQ358u0J/dI9tubjIaRS6ID/z0zZtO/hyZnZzZDBRz 4AqR6mGgc3EX/zb/JjInfPElXH2E7uceM1xKn+pY= 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 6.18 204/377] netfilter: bridge: eb_tables: close module init race Date: Thu, 28 May 2026 21:47:22 +0200 Message-ID: <20260528194644.311166849@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194638.371537336@linuxfoundation.org> References: <20260528194638.371537336@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 bfaba18f0e6a8..77df9e856c2e7 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