netfilter: xt_cluster: reject template conntracks in hash match
Subsystems (2)
PATCH 1/1 netfilter: xt_cluster: reject template conntracks in hash match
In reply to a message not in the archiveFrom: Wyatt Feng <[email protected]>
xt_cluster_mt() treats any non-NULL nf_ct_get() result as a fully initialized conntrack and passes it to xt_cluster_hash().
This causes a state confusion bug when the raw table CT target attaches a template conntrack to skb->_nfct before normal conntrack processing. Templates carry IPS_TEMPLATE status but do not have a valid tuple for hashing yet, so xt_cluster_hash() can hit its WARN_ON() path on the zeroed l3num field.
Reject template conntracks before hashing them. This matches existing netfilter handling for template objects and avoids hashing incomplete conntrack state.
Fixes 0269ea493734 ("netfilter: xtables: add cluster match")
Reported-by Yuan Tan <[email protected]>
Reported-by Yifan Wu <[email protected]>
Reported-by Juefei Pu <[email protected]>
Reported-by Zhengchuan Liang <[email protected]>
Reported-by Xin Liu <[email protected]>
Assisted-by Codex:GPT-5.4
Signed-off-by Wyatt Feng <[email protected]>
Signed-off-by Ren Wei <[email protected]>
--- net/netfilter/xt_cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/xt_cluster.c +1 -1
@@ -107,7 +107,7 @@ xt_cluster_mt(const struct sk_buff *skb, struct xt_action_param *par) } ct =nf_ct_get (skb, &ctinfo); -if (ct ==NULL ) +if (ct ==NULL ||nf_ct_is_template (ct))return false;if (ct->master)
Signature · 1 line
2.47.3