From patchwork Fri Sep 25 13:16:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 260215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29987C4727C for ; Fri, 25 Sep 2020 13:16:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1024235FD for ; Fri, 25 Sep 2020 13:16:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728836AbgIYNQZ (ORCPT ); Fri, 25 Sep 2020 09:16:25 -0400 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:52973 "EHLO mailrelay112.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728814AbgIYNQZ (ORCPT ); Fri, 25 Sep 2020 09:16:25 -0400 IronPort-SDR: lAsdkI1iOSoCmuM1HFCdnPuFg7TJRwX3a9KTEHcvv3zdaRl2DgzapcT6xq2oVoAWc948leSeRQ ina3g2yhvB7TE7TQgwcvkTQJPgYlzjS3LYhzHX8uvKz4cHZvy1dJfzOJHO1t7RjFvrRq4Qeo2q BOWL3c8iwlPpXm0++t9yeFP5LbzM38RfyO04rKxAOaXSI+ZrEfyMXaOLdO0rzco/cSeJJVkofz Zfk3iLDLPWdETU5arxysClA0+JRSHFjSiYg1e2Sb5/rvh+8wX8C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5QPtzvmKPgq+eTujXknll8ZZ6Wp2oEXaH+gFPR8P0qZeWbsgssGEWoSuwo+T/Hqh0acXjFPeXmyXLkx5iomCIK9E4jPXJyigb2Z1iehApJWfnxGCkyLEXrwcYWLResMZz+MLc9/iTEES7ehRJE71R20tw/11aBnLuzK9S0cr57j08J15+LLnxEo6TN0F9id032KT2xsmmMIRjk23L1woEBkyVeMz7J4g/pGGtxX/P5JTAg6OoDGz+BgCND9RBjBftGXR1aiWNmmBisxTt0pyd8Uf0l9A8mijgzE3yeyDb8ajaeEBJIv/6LH3HjwJ8B9xGja1KU7lFYpXJgHCWrziqdh+g37C4fXnkCdkKi2M6IRwGqF93qJxEKNsVteXQo2Vr/KDl4FYU6Dg93z50rEB5G0BLgqKApKyobWJKJAZPXyjkRASeulMtmIMDH5oHu5GRvdnuDEV4HtYWhIhCg= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ASEgDD7G1f/xCltltfHAEBATwBAQQEAQECAQEHAQEcgUqBHCACAQGCLV+NPpJikgQLAQEBAQEBAQEBNQECBAEBhEuCMSU4EwIDAQEBAwIFAQEGAQEBAQEBBQQBhg9Fgjcig0cLASMjgT8SgyaCWCm4PzOEEIURgUKBNgIBAQEBiCuFGoFBP4RfijQEtz2CcYMThGmSTA8ioRCTCKIYgXpNIBiDJFAZDY5WjhJCMDcCBgoBAQMJVwE9AY4fAQE X-IPAS-Result: A2ASEgDD7G1f/xCltltfHAEBATwBAQQEAQECAQEHAQEcgUqBHCACAQGCLV+NPpJikgQLAQEBAQEBAQEBNQECBAEBhEuCMSU4EwIDAQEBAwIFAQEGAQEBAQEBBQQBhg9Fgjcig0cLASMjgT8SgyaCWCm4PzOEEIURgUKBNgIBAQEBiCuFGoFBP4RfijQEtz2CcYMThGmSTA8ioRCTCKIYgXpNIBiDJFAZDY5WjhJCMDcCBgoBAQMJVwE9AY4fAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 25 Sep 2020 15:16:23 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org Cc: mkubecek@suse.cz, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 1/5 net-next] vxlan: don't collect metadata if remote checksum is wrong Date: Fri, 25 Sep 2020 15:16:02 +0200 Message-Id: <20200925131602.56461-1-fabf@skynet.be> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org call vxlan_remcsum() before md filling in vxlan_rcv() Signed-off-by: Fabian Frederick --- drivers/net/vxlan.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index b9fefe27e3e89..47c762f7f5b11 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1875,6 +1875,10 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) !net_eq(vxlan->net, dev_net(vxlan->dev)))) goto drop; + if (vs->flags & VXLAN_F_REMCSUM_RX) + if (!vxlan_remcsum(&unparsed, skb, vs->flags)) + goto drop; + if (vxlan_collect_metadata(vs)) { struct metadata_dst *tun_dst; @@ -1891,9 +1895,6 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) memset(md, 0, sizeof(*md)); } - if (vs->flags & VXLAN_F_REMCSUM_RX) - if (!vxlan_remcsum(&unparsed, skb, vs->flags)) - goto drop; if (vs->flags & VXLAN_F_GBP) vxlan_parse_gbp_hdr(&unparsed, skb, vs->flags, md); /* Note that GBP and GPE can never be active together. This is