ipvs: avoid oops for passive FTP
Subsystems (4)
Simon Horman
maintainerPATCH 1/1 ipvs: avoid oops for passive FTP
From: Julian Anastasov <[email protected]>
Fix Passive FTP problem in ip_vs_ftp:
- Do not oops in nf_nat_set_seq_adjust (adjust_tcp_sequence) when iptable_nat module is not loaded
---
Dave, this patch fixes a regression since 2.6.35 so please consider it for net. Julian has also found another regression, but the fix is a bit more complex so I have posted it to the netfilter list for review.
http://marc.info/?l=netfilter-devel&m=128339248723532&w=2
This change (and the other one) is also applicable to net-next, although there is some diff noise. Do you want me to resolve that and post a net-next version separately?
net/netfilter/ipvs/ip_vs_ftp.c renamed from linux/net/netfilter/ipvs/ip_vs_ftp.c +2 -1
@@ -45,6 +45,7 @@#include <linux/netfilter.h> #include <net/netfilter/nf_conntrack.h> #include <net/netfilter/nf_conntrack_expect.h> +#include <net/netfilter/nf_nat.h> #include <net/netfilter/nf_nat_helper.h> #include <linux/gfp.h> #include <net/protocol.h>
@@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_ap buf_len =strlen (buf); ct =nf_ct_get (skb, &ctinfo); -if (ct && !nf_ct_is_untracked (ct)) { +if (ct && !nf_ct_is_untracked (ct) &&nfct_nat (ct)) {/* If mangling fails this function will return 0 * which will cause the packet to be dropped. * Mangling can only fail under memory pressure,
David Miller
maintainerFrom: Simon Horman <[email protected]>
Date: Thu, 2 Sep 2010 18:07:10 +0900
Quoted 9 lines
From: Julian Anastasov <[email protected]>
Fix Passive FTP problem in
ip_vs_ftp:- Do not oops in
nf_nat_set_seq_adjust(adjust_tcp_sequence) wheniptable_natmodule is not loadedSigned-off-by Julian Anastasov <[email protected]>Signed-off-by Simon Horman <[email protected]>
Also applied, thanks Simon.
Julian Anastasov
maintainerHello,
Quoted 7 lines · Simon Horman
From: Julian Anastasov <[email protected]>
Fix Passive FTP problem in
ip_vs_ftp:- Do not oops in
nf_nat_set_seq_adjust(adjust_tcp_sequence) wheniptable_natmodule is not loaded
Quoted 8 lines
Signed-off-by Julian Anastasov <[email protected]>Signed-off-by Simon Horman <[email protected]>---
Dave, this patch fixes a regression since 2.6.35 so please consider it for net. Julian has also found another regression, but the fix is a bit more complex so I have posted it to the netfilter list for review.
Just to clarify that both patches for ip_vs_ftp are
only for code that come in 2.6.36-rc, 2.6.35 is ok and does not need them.
The other problem is that 2.6.36-rc comes with
requirement IPVS to keep netfilter conntracks for all connections, eg. DirectRouting, not only for LVS-NAT (ip_vs_ftp). I have a bigger patch to make the IPVS conntracking support an option (enabled by default only for ip_vs_ftp) but may be it is not appropriate for -rc series. So, for now we are fixing just the fatal problems but the risk of IPVS setups with low nf_conntrack_max value to stop processing high loads remains without making the conntrack support an option. Before now all conntracks were created and destroyed for every packet and nf_conntrack_max, even if low, probably is never reached.
Quoted 17 lines
http://marc.info/?l=netfilter-devel&m=128339248723532&w=2This change (and the other one) is also applicable to net-next, although there is some diff noise. Do you want me to resolve that and post a net-next version separately?
net/netfilter/ipvs/ip_vs_ftp.c renamed from linux/net/netfilter/ipvs/ip_vs_ftp.c +1
-0@@ -45,6 +45,7 @@#include <linux/netfilter.h> #include <net/netfilter/nf_conntrack.h> #include <net/netfilter/nf_conntrack_expect.h> +#include <net/netfilter/nf_nat.h> #include <net/netfilter/nf_nat_helper.h> #include <linux/gfp.h> #include <net/protocol.h>
net/netfilter/ipvs/ip_vs_ftp.c static int ip_vs_ftp_out(struct ip_vs_ap · line 366
Quoted 8 lines
net/netfilter/ipvs/ip_vs_ftp.c renamed from linux/net/netfilter/ipvs/ip_vs_ftp.c +1
-1@@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_ap buf_len =strlen (buf); ct =nf_ct_get (skb, &ctinfo); -if (ct && !nf_ct_is_untracked (ct)) { +if (ct && !nf_ct_is_untracked (ct) &&nfct_nat (ct)) {/* If mangling fails this function will return 0 * which will cause the packet to be dropped. * Mangling can only fail under memory pressure,
Regards
--
Julian Anastasov <[email protected]>