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

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