Skip to contentSkip to conversation

: Fix memory leak in ip_conntrack_ftp

PATCH In review Patrick McHardy 2 participants 2 messages Dec 8, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix memory leak in ip_conntrack_ftp

Hi Dave,

this patch fixes a remotely triggerable memory leak in ip_conntrack_ftp. exp leaks when a FTP date connection to a host different from the client (FXP) is attempted and the loose option is not set. It should go in 2.6.10 in my opinion.

Regards
Patrick

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/12/08 02:00:45+01:00 [email protected]
# [NETFILTER]: Fix memory leak in ip_conntrack_ftp
#
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/ipv4/netfilter/ip_conntrack_ftp.c
#   2004/12/08 02:00:39+01:00 [email protected] +1 -0
#   [NETFILTER]: Fix memory leak in ip_conntrack_ftp
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
diff -Nru a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c
--- a/net/ipv4/netfilter/ip_conntrack_ftp.c	2004-12-08 22:22:37 +01:00
+++ b/net/ipv4/netfilter/ip_conntrack_ftp.c	2004-12-08 22:22:37 +01:00
@@ -381,6 +381,7 @@
 		   problem (DMZ machines opening holes to internal
 		   networks, or the packet filter itself). */
 		if (!loose) {
+			ip_conntrack_expect_put(exp);
 			ret = NF_ACCEPT;
 			goto out;
 		}
#1 lore raw
Quoted 4 lines · On Wed, 08 Dec 2004 22:40:58 +0100 Patrick McHardy <[email protected]> wrote:

this patch fixes a remotely triggerable memory leak in ip_conntrack_ftp. exp leaks when a FTP date connection to a host different from the client (FXP) is attempted and the loose option is not set. It should go in 2.6.10 in my opinion.

I agree, I'll push this to Linus today.

Thanks.