From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124 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== 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== 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 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) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 31AC0606A693 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org 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/ 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== 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) From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org 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 Subject: [PATCH net 10/14] netfilter: nf_tables: only disable tables on a dormant transition Date: Sun, 29 Nov 2026 01:07:20 +0100 Message-ID: <20261129000724.797425-11-pablo@netfilter.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261129000724.797425-1-pablo@netfilter.org> References: <20261129000724.797425-1-pablo@netfilter.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Pablo Neira Ayuso --- 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