Skip to contentSkip to conversation

netfilter: nft_ct: reject expectation creation if conntrack has a master

PATCH New Pablo Neira Ayuso 1 participant 1 message Nov 1

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH v2 1/1 netfilter: nft_ct: reject expectation creation if conntrack has a master

The nft ct expectation object can attach its internal helper to an unconfirmed expected child, then arm the next expectation with that child as master, resulting in a long chain of sibling conntracks.

This custom ct expectation support barely works for one limited use-case, skip expectation creation to address this issue.

Fixes 857b46027d6f ("netfilter: nft_ct: add ct expectations support")

---
v2: check if from obj_eval().

 net/netfilter/nft_ct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nft_ct.c +1 -1
index 5a8db5592036..a2f87d657262 100644
@@ -1418,7 +1418,7 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
 	struct nf_conn *ct;
 
 	ct = nf_ct_get(pkt->skb, &ctinfo);
-	if (!ct || nf_ct_is_confirmed(ct) || nf_ct_is_template(ct)) {
+	if (!ct || nf_ct_is_confirmed(ct) || nf_ct_is_template(ct) || ct->master) {
 		regs->verdict.code = NFT_BREAK;
 		return;
 	}
Signature · 1 line
2.47.3