Blame SOURCES/conntrack-tools-1.4.4-nat_tuple-leak.patch

27ee02
From 1ba5e76a368aeb9fe17d3b691df4faa0dadc4523 Mon Sep 17 00:00:00 2001
27ee02
From: Kevin Cernekee <cernekee@chromium.org>
27ee02
Date: Thu, 26 Jan 2017 16:44:24 -0800
27ee02
Subject: conntrackd: cthelper: Don't leak nat_tuple
27ee02
27ee02
nfexp_set_attr() copies |nat_tuple| rather than taking ownership, so
27ee02
it should be freed at the end of the loop.  Some of the other helpers
27ee02
(like rpc.c) do this, but it is missing here.
27ee02
27ee02
Reported-by: Eric Caruso <ejcaruso@chromium.org>
27ee02
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
27ee02
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
27ee02
---
27ee02
 src/helpers/amanda.c | 1 +
27ee02
 src/helpers/ftp.c    | 1 +
27ee02
 src/helpers/tftp.c   | 1 +
27ee02
 3 files changed, 3 insertions(+)
27ee02
27ee02
diff --git a/src/helpers/amanda.c b/src/helpers/amanda.c
27ee02
index 9e6c4e7..faee1cd 100644
27ee02
--- a/src/helpers/amanda.c
27ee02
+++ b/src/helpers/amanda.c
27ee02
@@ -75,6 +75,7 @@ static int nat_amanda(struct pkt_buff *pkt, uint32_t ctinfo,
27ee02
 			break;
27ee02
 		}
27ee02
 	}
27ee02
+	nfct_destroy(nat_tuple);
27ee02
 
27ee02
 	if (port == 0) {
27ee02
 		pr_debug("all ports in use\n");
27ee02
diff --git a/src/helpers/ftp.c b/src/helpers/ftp.c
27ee02
index 27ab5eb..c3aa284 100644
27ee02
--- a/src/helpers/ftp.c
27ee02
+++ b/src/helpers/ftp.c
27ee02
@@ -423,6 +423,7 @@ static unsigned int nf_nat_ftp(struct pkt_buff *pkt,
27ee02
 			break;
27ee02
 		}
27ee02
 	}
27ee02
+	nfct_destroy(nat_tuple);
27ee02
 
27ee02
 	if (port == 0)
27ee02
 		return NF_DROP;
27ee02
diff --git a/src/helpers/tftp.c b/src/helpers/tftp.c
27ee02
index 45591c6..70dd28a 100644
27ee02
--- a/src/helpers/tftp.c
27ee02
+++ b/src/helpers/tftp.c
27ee02
@@ -65,6 +65,7 @@ static unsigned int nat_tftp(struct pkt_buff *pkt, uint32_t ctinfo,
27ee02
 	nfexp_set_attr_u32(exp, ATTR_EXP_NAT_DIR, MYCT_DIR_REPL);
27ee02
 	nfexp_set_attr(exp, ATTR_EXP_FN, "nat-follow-master");
27ee02
 	nfexp_set_attr(exp, ATTR_EXP_NAT_TUPLE, nat_tuple);
27ee02
+	nfct_destroy(nat_tuple);
27ee02
 
27ee02
 	return NF_ACCEPT;
27ee02
 }
27ee02
-- 
27ee02
cgit v0.12
27ee02