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 813DE33A9FC; Thu, 28 May 2026 20:41:43 +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=1780000904; cv=none; b=llHzSBpvqBtXALer3o7wfKR+z51RLyRDAEP+NsQTQB+TA6tS42qWcjkWDv4VdOJuBzz5VGVgI/8SwSSRxVa+gQRAg37hctRT0+dbboqdoV7MjW02xSW1ttF0SXBFI4UWlHpd1K99O+1Tsw43E4JAiBN2nxtwj6gHtZiASvxgx8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000904; c=relaxed/simple; bh=EtMWcq4ITbXUtGdwb8wFAmBILgvkk7vk19Aax76qYJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hT+KVmPBgdcXBlwyz+FWHXKSoqQNMakaQ3fFX7iTb506RkxIw2DR/cDmUVjf+QSMhVKMEaoDrf3L3oGCca5o53Bvx7IEWXE2QxsBrNrxKZw/gql9/J0BLlv8YajLhpnXbkTOmgydCsV5cLrrPyrX547rIaqQ5So+nU79yuClZeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PQxL9x8G; 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="PQxL9x8G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF64F1F000E9; Thu, 28 May 2026 20:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780000903; bh=ngalsQphrjPJjZ8+iXapbm9Erk2V/uAxG7OkVrMq4zw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PQxL9x8G4n6l31qpEXfVJ0sQiIayd6kBsKK7DNF73V5hLGP7hRJd4toXu+8uYBrlp I3NV1T9hVTFz/0Stx0SR03yIEXINjzZzvJwEvvLZdyRe61Y/6E46nCXvHu0u73JcOs hDcNSOqOIl1zJLqm9dtJ5VR22NAt/Nb3MnCb+Pt8= 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.12 174/272] netfilter: bridge: eb_tables: close module init race Date: Thu, 28 May 2026 21:49:08 +0200 Message-ID: <20260528194634.184606386@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: 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 6240bb2b5b5b7..d480a91f081d3 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