From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: [PATCH] ipvs: avoid oops in nf_ct_seqadj_set when called from ip_vs_ftp helper Date: Fri, 13 Dec 2013 22:37:48 +0100 Message-ID: <20131213214023.14478.74738.stgit@dragon> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Jesper Dangaard Brouer , Pablo Neira Ayuso , "David S. Miller" , netdev@vger.kernel.org, "Patrick McHardy" To: Simon Horman , Julian Anastasov , lvs-devel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53784 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524Ab3LMViH (ORCPT ); Fri, 13 Dec 2013 16:38:07 -0500 Sender: netdev-owner@vger.kernel.org List-ID: The IPVS FTP helper ip_vs_ftp can trigger an OOPS in nf_ct_seqadj_set, after commit 41d73ec053d2 (netfilter: nf_conntrack: make sequence number adjustments usuable without NAT). We can avoid the oops in nf_ct_seqadj_set() by in ip_vs_ftp_out() instead of calling nf_nat_mangle_tcp_packet() we simply call __nf_nat_mangle_tcp_packet() with a "false" last parameter, which indicate not invoking the seqadj code. After this fix, I've tested that FTP over IPVS, with module ip_vs_ftp loaded, works for both passive and active FTP. Fixes: 41d73ec053d2 (netfilter: nf_conntrack: make sequence number adjustments usuable without NAT) Signed-off-by: Jesper Dangaard Brouer --- I'm uncertain if this is the correct fix. Perhaps the ip_vs_ftp helper need to allocate/init the seqadj extension instead? net/netfilter/ipvs/ip_vs_ftp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 77c1732..b8f9573 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c @@ -268,10 +268,10 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp, * packet. */ rcu_read_lock(); - ret = nf_nat_mangle_tcp_packet(skb, ct, ctinfo, + ret = __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, iph->ihl * 4, start-data, end-start, - buf, buf_len); + buf, buf_len, false); rcu_read_unlock(); if (ret) { ip_vs_nfct_expect_related(skb, ct, n_cp,