Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1628059ybh; Sun, 15 Mar 2020 07:17:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvS1i7vtznvDcqqxDmcRW6SG71fNgitxPc37Lu3qASKK3t/Z3ORp4sf+H08B2/rvipqapjp X-Received: by 2002:a9d:3de4:: with SMTP id l91mr19694411otc.35.1584281869990; Sun, 15 Mar 2020 07:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584281869; cv=none; d=google.com; s=arc-20160816; b=nbd270UTZ9TbsBDkOvn/AexJSi2LW0zo1UicdpP2s8cgss9TrjjOjYMTS0qo+jWftC jfDTts68ryjvwRinyKEa5YY6MojVWNT2TRtD3MjOjL8BgVnKL3yZtW9xBg6oDQn394eq aOhKx6B7W6igHgJP5Uozq6mvmfOxXZYI7Zb1q7j+yKVpI7YZ/c4GAZ/75lC1OUi3RxX3 E1uTs0FlU9D6iA4k2ZbcYKacMUkI9jO3k5sEdUfPW+eL8uAhHoGew9jK/+K3Wxp4BmSU MHPo4uc3l2EdhrxYD4R01F2zkJ/voXpehuzlq0U42hM8QnrzrrgR+ofy+llUHiUp5M4q AWWg== 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=FjLuf3zB9PqfNxgew+C12Uja/ET465Ux43zrw3d7g88=; b=AmggqOYqnmqS648kwja1pa5ul2TP52hhDV2/UnoVlzDH7e3LPWjM4/AOQMq1QEfLy8 AeujeUAGQa38nu2nFSE81umVUkwb0zV9jLOt3Yh9oH5E2K830DFlI1fLlcHLsQvFVMHF DeZv1I1sXXGMZAi2hP+ycup+AnJZzkF3hNxDEm5Q7liND/asbfz5aqlpjcRMrJvvDZdg Yicd3R+fP6xJ5Ri3wiBaLhVQdAoI21EM55oBTevsdsq00uNHPxp9gbvE4qzCQ5t2nfmL gwBGm1J/Pga/si9Uoa0odhxgk7Uz5D7VmfQCk9rmJovrk4Ycj4pAkbsTSEJsbz9Z57cO sIlw== 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 q11si8503595otc.153.2020.03.15.07.17.37; Sun, 15 Mar 2020 07:17:49 -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 S1728782AbgCOOQU (ORCPT + 99 others); Sun, 15 Mar 2020 10:16:20 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:3134 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgCOOQU (ORCPT ); Sun, 15 Mar 2020 10:16:20 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.7]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45e6e38a5144-caed9; Sun, 15 Mar 2020 22:16:07 +0800 (CST) X-RM-TRANSID: 2ee45e6e38a5144-caed9 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.241]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee45e6e38a0e85-2436e; Sun, 15 Mar 2020 22:16:07 +0800 (CST) X-RM-TRANSID: 2ee45e6e38a0e85-2436e 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 4/4] netfilter: nf_flow_table: reload iph in nf_flow_tuple_ip Date: Sun, 15 Mar 2020 22:15:05 +0800 Message-Id: <1584281705-26228-4-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 iph at the right place. Fixes: 7d2086871762 ("netfilter: nf_flow_table: move ipv4 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 954737f..610c60a 100644 --- a/net/netfilter/nf_flow_table_ip.c +++ b/net/netfilter/nf_flow_table_ip.c @@ -190,6 +190,7 @@ static int nf_flow_tuple_ip(struct sk_buff *skb, const struct net_device *dev, if (!pskb_may_pull(skb, thoff + sizeof(*ports))) return -1; + iph = ip_hdr(skb); ports = (struct flow_ports *)(skb_network_header(skb) + thoff); tuple->src_v4.s_addr = iph->saddr; -- 1.8.3.1