* [PATCH nf v3 0/1] netfilter: nf_tables: only disable tables on a dormant transition
@ 2026-11-24 7:33 Ma Xinmeng
0 siblings, 0 replies; only message in thread
From: Ma Xinmeng @ 2026-11-24 7:33 UTC (permalink / raw)
To: Pablo Neira Ayuso, Florian Westphal
Cc: netfilter-devel, netdev, Phil Sutter, Xuanqiang Luo
Hi,
This is v3 of the fix. v2 included a selftest in the kernel tree; review
asked to move it to nftables.git as a shell test under
tests/shell/testcases/transactions/, where run-tests.sh already handles
the tainted-kernel check. v3 keeps only the one-line kernel fix; the test
is sent separately as [PATCH nft] (0052dormant_table_adopt_0).
The problem is unchanged. A dormant table has no registered basechain
hooks. Re-owning an already dormant PERSIST orphan sets
__NFT_TABLE_F_UPDATE because of the adoption, and nf_tables_commit()
used to call nf_tables_table_disable() for it. That cleared DORMANT,
walked the chains, and unregistered a hook that was never registered,
triggering WARN_ONCE("hook not found") in __nf_unregister_net_hook().
v3 only changes the NEWTABLE commit path to check
__NFT_TABLE_F_WAS_AWAKEN, which records a real awake-to-dormant
transition:
- if (table->flags & NFT_TABLE_F_DORMANT)
+ if (table->flags & __NFT_TABLE_F_WAS_AWAKEN)
nf_tables_table_disable(net, table);
The WARN was found by FuzzAnything's AI-assisted kernel fuzzer while
fuzzing nftables netlink messages in a user and network namespace, and
I reproduced it at runtime on 7.3.0-rc4, 7.3.1, 7.4-rc1, 7.4-rc2, and
7.4-rc3. The v2 code was A/B tested on 7.4.0-rc3: baseline WARN, patched
no WARN, and a real awake-to-dormant transition still disables the hook.
Changes in v3:
- drop the kernel selftest; no change to the one-line fix
- move the test to nftables.git as a separate [PATCH nft]
- keep Fixes: 31bf508be656 ("netfilter: nf_tables: Implement table adoption support")
Link: https://lore.kernel.org/all/tencent_19A48DA487BBFCFD990AC5A8010C663EA007@qq.com/
Thanks,
Ma Xinmeng
Ma Xinmeng (1):
netfilter: nf_tables: only disable tables on a dormant transition
net/netfilter/nf_tables_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.56.0.windows.4.niugit
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-24 7:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 7:33 [PATCH nf v3 0/1] netfilter: nf_tables: only disable tables on a dormant transition Ma Xinmeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox