Skip to contentSkip to conversation

netfilter: nf_conntrack: Support expectations in different zones

PATCH New Pablo Neira Ayuso 1 participant 1 message Dec 14, 2015

Subsystems (3)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nf_conntrack: Support expectations in different zones

From: Joe Stringer <[email protected]>

[ upstream commit 4b31814d20cbe5cd4ccf18089751e77a04afe4f2 ]

When zones were originally introduced, the expectation functions were all extended to perform lookup using the zone. However, insertion was not modified to check the zone. This means that two expectations which are intended to apply for different connections that have the same tuple but exist in different zones cannot both be tracked.

Fixes 5d0aa2ccd4 (netfilter: nf_conntrack: add support for "conntrack zones")
Cc <[email protected]> # 3.2.x
Cc <[email protected]> # 3.4.x
Cc <[email protected]> # 3.12.x
Cc <[email protected]> # 3.14.x
Cc <[email protected]> # 3.18.x
Cc <[email protected]> # 4.1.x
---
 net/netfilter/nf_conntrack_expect.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_expect.c +2 -1
index 7a17070..b45a422 100644
@@ -219,7 +219,8 @@ static inline int expect_clash(const struct nf_conntrack_expect *a,
 			a->mask.src.u3.all[count] & b->mask.src.u3.all[count];
 	}
 
-	return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask);
+	return nf_ct_tuple_mask_cmp(&a->tuple, &b->tuple, &intersect_mask) &&
+	       nf_ct_zone(a->master) == nf_ct_zone(b->master);
 }
 
 static inline int expect_matches(const struct nf_conntrack_expect *a,
Signature · 1 line
1.7.10.4