Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1627321ybh; Sun, 15 Mar 2020 07:16:57 -0700 (PDT) X-Google-Smtp-Source: ADFU+vthtSusCfaeRt73XAB7yTvSwRxoYqn/S7JDSareCFBLDRI/Xa4u83bhUF9l3PHYcDkCZxjr X-Received: by 2002:a05:6830:1d69:: with SMTP id l9mr19118842oti.192.1584281817375; Sun, 15 Mar 2020 07:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584281817; cv=none; d=google.com; s=arc-20160816; b=xodxQB0AFB728VIeE4lm2rP345fsm1jxlAb7HyPktJMKD80BPu6Vntp53XJL2ILMRw 6MGxnGykKFjLhLD1Equ9hB3BXJfo/N1O2gGau0+MUOjvg1WWCjpzKKjUSTkH2ULvFLfd 777Gkmdmm8c4heUvYknuxB8vRFzTWJst+XmBjFIWj9O4m6gD36o6zjpttQqZtXQeIS3a wlBvz6SqI7CbblD6kf9pR06Sq/qZPZloozIJs1v4wzwa3RVrmmYnG00TlwDilGXfcfqk nlJpS0GzGQgTt1B0phC60fCUtsPgK9kpZCWjSeNrArT8krxg1tJNKnuNwOW4hM0nMPl/ sakw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=jo6mlugQ7WRUf8eKlje9hz9g1d1INFIF+XyRT9N2HSk=; b=f637Ym5YqAFyeWKIys/rXSBd1Ft0xVp0YPO/xqZuaruMO3N7DIFMYSjFxBGixydipG wnqmVY4N00sDG0KJ2fw1K+bQ5fOIekPKqQUl4pblDO5ybi/Up0ullJpxdybx8imHp/Ck l70VEu9yejHTHBt0wi3cYt2BOWoU6mEbt9oQFJwSav7Wu8XUCv3neXEznhkn4acaq4T8 Ccg/La7GUrRokpyAG5VOJa5hJwglHbuNW6K0Wbod+eIrH6/09SWOK8f6djZb1znRLKRG 2QXy1WCME3jTZX+GGZgEuwubOcVX1iMjfjgAbOkf002SfsK+FvWauZfowsK7LTAz7EAX Mxqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i187si4843345oif.89.2020.03.15.07.16.45; Sun, 15 Mar 2020 07:16:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728764AbgCOOQN (ORCPT + 99 others); Sun, 15 Mar 2020 10:16:13 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:3995 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgCOOQM (ORCPT ); Sun, 15 Mar 2020 10:16:12 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee95e6e389bf93-cac14; Sun, 15 Mar 2020 22:15:55 +0800 (CST) X-RM-TRANSID: 2ee95e6e389bf93-cac14 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.241]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee75e6e38888e7-22076; Sun, 15 Mar 2020 22:15:55 +0800 (CST) X-RM-TRANSID: 2ee75e6e38888e7-22076 From: Haishuang Yan To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH 3/4] netfilter: nf_flow_table: reload ipv6h in nf_flow_tuple_ipv6 Date: Sun, 15 Mar 2020 22:15:04 +0800 Message-Id: <1584281705-26228-3-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1584281705-26228-1-git-send-email-yanhaishuang@cmss.chinamobile.com> References: <1584281705-26228-1-git-send-email-yanhaishuang@cmss.chinamobile.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since pskb_may_pull may change skb->data, so we need to reload ipv6h at the right place. Fixes: a908fdec3dda ("netfilter: nf_flow_table: move ipv6 offload hook code to nf_flow_table") Signed-off-by: Haishuang Yan --- net/netfilter/nf_flow_table_ip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c index 942bda5..954737f 100644 --- a/net/netfilter/nf_flow_table_ip.c +++ b/net/netfilter/nf_flow_table_ip.c @@ -452,6 +452,7 @@ static int nf_flow_tuple_ipv6(struct sk_buff *skb, const struct net_device *dev, if (!pskb_may_pull(skb, thoff + sizeof(*ports))) return -1; + ip6h = ipv6_hdr(skb); ports = (struct flow_ports *)(skb_network_header(skb) + thoff); tuple->src_v6 = ip6h->saddr; -- 1.8.3.1