ipvs: avoid oops for passive FTP
Subsystems (3)
Julian Anastasov
maintainerPATCH 1/1 ipvs: avoid oops for passive FTP
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
---
This patch is for 2.6.36
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,
Simon Horman
maintainerQuoted 10 lines · Julian Anastasov
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]>---
This patch is for 2.6.36
Thanks, looks good. Are you ready for me to send this to netdev and Dave Miller? Also, I know that you are working on the bigger picture for post 2.6.36, but I think it would be worth getting this change into net-next now. Likewise for the next patch.
Quoted 20 lines
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,
Julian Anastasov
maintainerHello,
Quoted 10 lines · Simon Horman
Quoted 9 lines · Julian Anastasov
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]>---
Quoted 6 lines
Quoted 1 line
This patch is for 2.6.36
Thanks, looks good. Are you ready for me to send this to netdev and Dave Miller? Also, I know that you are working on the bigger picture for post 2.6.36, but I think it would be worth getting this change into net-next now. Likewise for the next patch.
Yes, this patch should go both to 2.6.36 (stable) and
net-next, I think. I'm sending all my IPVS patches first to you for comments and proper merging for net-next. Thanks!
Quoted 16 lines
Signed-off-by Simon Horman <[email protected]>Quoted 14 lines
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> @@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_ap buf_len =strlen (buf);
Quoted 7 lines
net/netfilter/ipvs/ip_vs_ftp.c static int ip_vs_ftp_out(struct ip_vs_ap · line 366
Quoted 6 lines
net/netfilter/ipvs/ip_vs_ftp.c renamed from linux/net/netfilter/ipvs/ip_vs_ftp.c +1
-1ct =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]>
Simon Horman
maintainerQuoted 17 lines · Julian Anastasov
Hello,
Quoted 12 lines · Simon Horman
Quoted 10 lines · Julian Anastasov
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]>---
This patch is for 2.6.36
Quoted 8 lines
Quoted 4 lines
Thanks, looks good. Are you ready for me to send this to netdev and Dave Miller? Also, I know that you are working on the bigger picture for post 2.6.36, but I think it would be worth getting this change into net-next now. Likewise for the next patch.
Yes, this patch should go both to 2.6.36 (stable) and
net-next, I think. I'm sending all my IPVS patches first to you for comments and proper merging for net-next. Thanks!
Understood. I wasn't quite sure how you wanted to handle things.
Quoted 28 lines
Quoted 16 lines
Signed-off-by Simon Horman <[email protected]>Quoted 14 lines
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> @@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_ap buf_len =strlen (buf);Quoted 7 lines
net/netfilter/ipvs/ip_vs_ftp.c static int ip_vs_ftp_out(struct ip_vs_ap · line 366
Quoted 6 lines
net/netfilter/ipvs/ip_vs_ftp.c renamed from linux/net/netfilter/ipvs/ip_vs_ftp.c +1
-1ct =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]>