Article View: linux.kernel.netdev
Article #24014[PATCH net 10/14] netfilter: nf_tables: only disable tables on a dormant transition
From: Pablo Neira Ayuso
Date: Sun, 29 Nov 2026 00:07
Date: Sun, 29 Nov 2026 00:07
41 lines
9786 bytes
9786 bytes
From: Ma Xinmeng <1564938642@qq.com>
nf_tables_commit() calls nf_tables_table_disable() for every NEWTABLE
transaction that has NFT_TABLE_F_DORMANT set and __NFT_TABLE_F_UPDATE.
Since table adoption introduced __NFT_TABLE_F_WAS_ORPHAN, UPDATE no
longer implies a dormant state change: re-owning an already dormant
PERSIST orphan sets UPDATE because of the adoption, even though the
table never left the dormant state. The commit then clears DORMANT,
walks the basechains, and unregisters a hook that was never registered,
which triggers WARN_ONCE("hook not found") in
__nf_unregister_net_hook().
Use __NFT_TABLE_F_WAS_AWAKEN, which records an awake-to-dormant
transition, instead of the current DORMANT flag. This skips the disable
for an already dormant adopted table while preserving the genuine
awake-to-dormant path.
Fixes: 31bf508be656 ("netfilter: nf_tables: Implement table adoption support")
Signed-off-by: Ma Xinmeng <1564938642@qq.com>
Reviewed-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_tables_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 8b94b5e7dbdb..b184c739cb67 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -11078,7 +11078,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
nft_trans_destroy(trans);
break;
}
- if (table->flags & NFT_TABLE_F_DORMANT)
+ if (table->flags & __NFT_TABLE_F_WAS_AWAKEN)
nf_tables_table_disable(net, table);
table->flags &= ~__NFT_TABLE_F_UPDATE;
--
2.47.3
Technical Details
Message-ID:
<20261129000724.797425-11-pablo@netfilter.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373307-linux-kernel-netdev=dewy.ruReferences:
<20261129000724.797425-1-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373307-linux-kernel-netdev=dewy.ru From: pablo@netfilter.org (Pablo Neira Ayuso) Newsgroups: linux.kernel.netdev Subject: [PATCH net 10/14] netfilter: nf_tables: only disable tables on a dormant transition Date: Sun, 29 Nov 2026 01:07:20 +0100 Organization: Usenet Network Message-ID: <20261129000724.797425-11-pablo@netfilter.org> References: <20261129000724.797425-1-pablo@netfilter.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1064592"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:F1CrJ7KveCuLZnHsQPFGapJeh4E= sha256:raxLUulVnFvdPpzdwxdHWvWRapvfz5BJcP4tdDopw7s= sha1:R4asGAozsDDiaALIDDENn5B+JP8= sha256:1mfRDoViD6K6nRvC9Em+OxrCEDp11Eq7aVQbWCuLsIg= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 09FBB125F8E; Sun, 29 Nov 2026 03:08:25 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=netfilter.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X27QjDfaxaa0; Sun, 29 Nov 2026 03:08:22 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-373307-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 3798C125F88; Sun, 29 Nov 2026 03:08:14 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id DCDDF27A03; Sun, 29 Nov 2026 00:07:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1795910867; b=39Neyr4bkgkYJdLEPaeA9npGWOwtH4nvD87QejDhVDIjqe7j8ZGkfB41oMCnHSzoSxAS eSE7BESB+uhE1HA2mHWfrDmlt2XLZgigS+bHkX+I4bivcWo0WEiniNf2WckvIBDoDMgra mbW4ensD9MpgYpIBWxw01ASZNVVyIc3Lyt4An5B/PTcE/4yEsqC8bAYj5aQUGkaFLXF8l nCnMAvb0+5YIlg/xqVK70yKhXDzDby6TjOdSxbkcp50cFKo7+dY4sa/lfG3KL8pur/avU gYQdxijOOgBRbD+kgttEUVQXwVsYc0i51JDLR8ppW+ILFUXzAVRIPPETA9J6UlPziTA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795910867; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=WLDLSdXAWyMyU79lU+BHPsbrg/qiVfED5b6UofxOrQo=; b=QhmBtXngRRslk3kZ9OZZ9wz1Xi/grnJ4U9nilitCT79ABQ/+UJ1LgVbe+Fqd2lWQvTqw nwiAdwo+EuXNRxMgQ9Az0WGe0IPK8scvNqrXlw81EE2PpA7UuJz+8nTOWsngE3o3F0mPF OqJIzsl6tZWsd/HxUkV9FJl9OcZ0YFTU+xvS8L/BuB9zh98pAZyUDYnE8JxDh1LcCdXKu uA1AkRXyCAmeXe9pO9ZyJ2K38Sg4rLll3A4It+Yg2vR4QxuuS6yZm4ACjAbPPqPrfTDDr 3MESVOYDtwaqwq12/ZOLncWxKHfki5xyLRqKvZmVAQ6ymlnPI3yzk3OODsIfgkTlfhw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b="pMeEzxH/"; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; arc=fail smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 816FA606A33B; Sun, 29 Nov 2026 00:07:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=pMeEzxH/ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795910866; b=0sBFvRYazBkmFRg4JuL7JJk9dSa68bBt8oh/bcffV8dOrcFLDyCUqNqz3+RbLNv3ia6+ qsIuTDbH6H4kM8oarUV/8hYexBlGyixUmluujPhLKa/aziqVa7GPUgYiv53iauY5128Wg JXUn8XYD5IJSaTjgr/fsGHGW5jhhMqDXlzxchLO1VV/gp3g9OXbzZNxr91zsgkCDMCuLp qwm0ukwLW99V9kKlsrrGqMmO57jbmuI9x4WyriO14gUuJFgvmeC5MXylX0/rJssJYuYqw 60BFzKINn55W0J3gEIlwvGPh60B0KHYKW1Z4GZxyF51I0ZKYq1Dl3gsSoA50QV9b/gw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795910866; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Spam-Status:X-Spam-Checker-Version; bh=WLDLSdXAWyMyU79lU+BHPsbrg/qiVfED5b6UofxOrQo=; b=B1HJ1CF/WdnSjIrrcbaPomFrarP9dBbBWP8thVrgB5rjWQi6CRmoQvYi8jQKMBZANDJT +NnliD64IyOOz+fySGcc0AQy2ksHKkbiOf9YqaHAhu9XPg1gYvvUU+mVxqWyK5U87Nc0Q 8zyf/WEGRGqxSwYsO+BQ8Pr3N/8cgb35TeY/58GQMFksIbDpAmLitENUmNfwLeUh5wfBl kGO7mFIyZWMl4/iO2H2HNsrBn8vKoi3SceU2hJOuuAmPW7tF6jFbl1kIDdmGZ+WVxeVTe j/9msans6n9gXuVbHLDn+xXxXPqjOiDuh1kgEK7S7ogaSfX7qjx98s8/BKe3SdiIcgA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b="pMeEzxH/"; arc=none smtp.remote-ip=217.70.190.124 X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31AC0606A693; Sun, 29 Nov 2026 00:07:45 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 31AC0606A693 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org; s=2025; t=1795910864; bh=WLDLSdXAWyMyU79lU+BHPsbrg/qiVfED5b6UofxOrQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pMeEzxH/ED0pj1oRBPenz4TyFII0xzWCH+++AZGVbnz16aLZHznj3bbbHdhTze7Ki /ph96MQYwZGK/IPDxMCk3/fXyoFc3bL/EhT/Tcb4MDnaOsTxQTK4U3Rz/1YijmZSzU CjcikCS2S0tDsoCJXEzoT3MBjiTQslCv17UIyebHgP8/45eM/0KTlhwVFs3cTQHPGT /XbqvQjCHB5RdHL32YpgGWtHJqItjlkzRqLFngcI+7v/WRfDvL51n7sp2u0w9mGHPh pB5YikTY9DME2KnW5xA5/u4NxVG9/WrI8YQ9tpGSP1fNtK3A+QcTv/xes3TbctL7MQ 4LKhZcPwmMxLg== X-Received: from localhost.localdomain (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with ESMTPSA id D5A72601B4; Sun, 29 Nov 2026 01:07:43 +0100 (CET) X-Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-Mailer: git-send-email 2.47.3 X-In-Reply-To: <20261129000724.797425-1-pablo@netfilter.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list