Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3299315ybb; Tue, 31 Mar 2020 02:23:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs00/szM7g2MPXFGDEI3XCxz3Zv6qJXqcMs/tmfD0BLs633iMMRlB7d/hmlPL7zlzx3s9ba X-Received: by 2002:a4a:6841:: with SMTP id a1mr2396019oof.18.1585646618061; Tue, 31 Mar 2020 02:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646618; cv=none; d=google.com; s=arc-20160816; b=GhqFy9Wcyk66NaV4Av2wPFtAWZKt7RLXUMx5K/bOYZW13ZHAvQiaI/vhAhXsGSzbXR EcSZ/25WD2TkmmQN60U/NZ3xYum0AYpvzBZN2F5geoiCDol5xXHDRET7isLlm/93vfHp xMXtIyxPxnOZ0LBaIVz5TAZ+V/M5J834tavL7gZU8YRLeFD2c2gQhhBBh+3U/zNXDteZ xGZ+1pLCu0K6Tu69KXkZCSD3mMNX1v+DxXTp7DIapKzFAV/jpUpHshXB69cuLHwtMnQe 7rd2MUEgeUqsS0SVVYR3FgSrwTfz1P95xA7T+RXwA40rKE70/tpB+vZb3ETIM0kleUix Cejg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uKdS2dqgDG3ZJZpD5KLCfIkA+hY4+HFjOB/+ofSySTU=; b=nFL53r4JmC+Fsm3MzJXQk59hsmbTBKnCqN23TknWIruPKf5c1pZstZyFOR5skeu4Kh Ui2M9hoHXt9zzSPndKkamg/NET0CKK0qkX/1RIRh0IeKFZz2OPwCXrfKLLYWRuh0+pXj RtoVB1xXcKuMPym29wOgSq4UmY8Bvew6ZC0IDUCyQ88jJ5roghaQLv8O99U8SFd0kcj3 nq/Wnh5vZ35eVxBt8yzrlM2Px0gua+r05QlLrB/GyiuF8mrBsTOli2DxxOVweuunaa3t zuAQi9yglEpur6I0131B4ydmHxcRPmXfVzD+3XU8hZRhANAOu+SsiHxmd3AmfAlgMSjs 61pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yYT9n4Sw; 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 k10si7447287otr.174.2020.03.31.02.23.26; Tue, 31 Mar 2020 02:23:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=yYT9n4Sw; 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 S1731330AbgCaJIU (ORCPT + 99 others); Tue, 31 Mar 2020 05:08:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:50630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730885AbgCaJIR (ORCPT ); Tue, 31 Mar 2020 05:08:17 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B535520675; Tue, 31 Mar 2020 09:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645697; bh=mtQU7ldRBNRJFWrn0CPhkTfp5h06s2WMQ8Ki9GlK1HE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yYT9n4Sw1wNx+/lBq1MyByN0mlDGrzHDGP4veqJGPuIv2bYgshfWJf6hZ0q15amoi jtLcAT9FqH5uub4TZATAKxsSuKfY77FHiBNrcf1RnaJoiCXNzkoALcccyD5CMZ/Srb lfKc6RUKLIJm/ydSqi9NUIsZU+v80NF5QfgIThs0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haishuang Yan , Pablo Neira Ayuso Subject: [PATCH 5.5 135/170] netfilter: flowtable: reload ip{v6}h in nf_flow_tuple_ip{v6} Date: Tue, 31 Mar 2020 10:59:09 +0200 Message-Id: <20200331085437.894672280@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haishuang Yan commit 41e9ec5a54f95eee1a57c8d26ab70e0492548c1b upstream. Since pskb_may_pull may change skb->data, so we need to reload ip{v6}h at the right place. Fixes: a908fdec3dda ("netfilter: nf_flow_table: move ipv6 offload hook code to nf_flow_table") Fixes: 7d2086871762 ("netfilter: nf_flow_table: move ipv4 offload hook code to nf_flow_table") Signed-off-by: Haishuang Yan Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_flow_table_ip.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/netfilter/nf_flow_table_ip.c +++ b/net/netfilter/nf_flow_table_ip.c @@ -189,6 +189,7 @@ static int nf_flow_tuple_ip(struct sk_bu 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; @@ -449,6 +450,7 @@ static int nf_flow_tuple_ipv6(struct sk_ 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;