diff mbox

[nf] netfilter: Support expectations in different zones

Message ID 1437539851-65437-1-git-send-email-joestringer@nicira.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Joe Stringer July 22, 2015, 4:37 a.m. UTC
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")

Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
 net/netfilter/nf_conntrack_expect.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Pablo Neira Ayuso July 22, 2015, 7:57 p.m. UTC | #1
On Tue, Jul 21, 2015 at 09:37:31PM -0700, Joe Stringer wrote:
> 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")

Applied, thanks Joe.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 7a17070..b45a422 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -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,