From patchwork Fri Dec 13 21:37:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 301180 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6A4DC2C009F for ; Sat, 14 Dec 2013 08:38:13 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157Ab3LMViI (ORCPT ); Fri, 13 Dec 2013 16:38:08 -0500 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 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBDLboRs007316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Dec 2013 16:37:50 -0500 Received: from dragon.localdomain (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBDLbmTc004306; Fri, 13 Dec 2013 16:37:49 -0500 Received: from [127.0.0.1] (localhost [IPv6:::1]) by dragon.localdomain (Postfix) with ESMTP id 6F9E6E405FC; Fri, 13 Dec 2013 22:37:48 +0100 (CET) From: Jesper Dangaard Brouer Subject: [PATCH] ipvs: avoid oops in nf_ct_seqadj_set when called from ip_vs_ftp helper To: Simon Horman , Julian Anastasov , lvs-devel@vger.kernel.org Cc: Jesper Dangaard Brouer , Pablo Neira Ayuso , "David S. Miller" , netdev@vger.kernel.org, "Patrick McHardy" Date: Fri, 13 Dec 2013 22:37:48 +0100 Message-ID: <20131213214023.14478.74738.stgit@dragon> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Julian Anastasov --- 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(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,