From patchwork Thu Aug 29 17:55:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1155451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S7JAUHFX"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46K9Pt2FPHz9s4Y for ; Fri, 30 Aug 2019 04:00:34 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A93F94C94; Thu, 29 Aug 2019 17:57:31 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1DA244BAD for ; Thu, 29 Aug 2019 17:55:46 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CCE2BEC for ; Thu, 29 Aug 2019 17:55:45 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id m3so1961756pgv.13 for ; Thu, 29 Aug 2019 10:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fvg7lTz7Nzj2wA2xGd07i6WTWdvQyCoHanMnrTCLvFY=; b=S7JAUHFX6NUMKzU3nJAKDR8FvJ1yaJebRBxGTEw7xEgnV0ZifXbGoxDA0MT5DQDF2Y vklvu/GOyB3S/kGCfKuguldQuCPXxK5QJnOsZlg6Piua2WKJMsqDgifvkItwiIxOhjQR eCEJx1P9gLIhW6SMf4in8J8KQbwJd8tDb9Nb0sKFFYUXahxhCO7XzZ+ymVd8VpiSs3h9 ZNV22FNk7WAVKgkJdOjU9cPsbIlaivm79priNnaKVRRRyUJrP7RkGN0czpjgcmgYImFZ SfDwM84NiKb3QOm+vq9fhOrY9JUUQATn/j9O9NJepDojwPTVULhS1kPRFTOcBv3VLVR8 2Qqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fvg7lTz7Nzj2wA2xGd07i6WTWdvQyCoHanMnrTCLvFY=; b=OK0TzJiBo9Q1+n5oG85MFXhhiLEGw70eMpfxHROQSTYTC7ZuXmDwnkLwWQOEpLEVj3 v1XyB19prjlwiqt+peH6YzASC33hRXGABSMwEG1JGvrjH/jWAitduFvZmieuQyH8xjt0 zmvLUPNOWuusJeMIa65Ho2nYGOQBrO8m3uHf2eidr6PTYShOvopixJwMovVcK4C67pHF 7wP3KVHxx6KrG6faWtFJpjFKMhz31jneGxoIOXvZ6gKoPmQNlXxOSj/teVf+Eue/HCPI SZ5bLhsXVI2r6prWh6HP+QW8apGPby9PbETrtNyHxWIV3bqciWpqo0cZxAP/0hKrbdCW IK6A== X-Gm-Message-State: APjAAAV+14bdNcCRQmczRCiQNjhnFUpfJIYAfpi8Ny4OLXS/v/Mq88g+ gUZ7GAF3P9mFprw1C5tb2hYxhyES X-Google-Smtp-Source: APXvYqzE056UJMBugxUPAnWYB2mDLZysDltMsJTK75IohgaahZ8n9nnaQ5kdjz7fAz7/3PwzqBLwWw== X-Received: by 2002:a17:90a:1a8d:: with SMTP id p13mr11616799pjp.15.1567101345112; Thu, 29 Aug 2019 10:55:45 -0700 (PDT) Received: from gizo.domain (97-115-90-227.ptld.qwest.net. [97.115.90.227]) by smtp.gmail.com with ESMTPSA id s13sm3751532pfm.12.2019.08.29.10.55.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 10:55:44 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org, jpettit@ovn.org Date: Thu, 29 Aug 2019 10:55:40 -0700 Message-Id: <1567101340-27825-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1567101340-27825-1-git-send-email-gvrose8192@gmail.com> References: <1567101340-27825-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH branch-2.6 2/2] datapath: Clear the L4 portion of the key for "later" fragments X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Justin Pettit Upstream commit: commit 0754b4e8cdf3eec6e4122e79af26ed9bab20f8f8 Author: Justin Pettit Date: Tue Aug 27 07:58:10 2019 -0700 openvswitch: Clear the L4 portion of the key for "later" fragments. Only the first fragment in a datagram contains the L4 headers. When the Open vSwitch module parses a packet, it always sets the IP protocol field in the key, but can only set the L4 fields on the first fragment. The original behavior would not clear the L4 portion of the key, so garbage values would be sent in the key for "later" fragments. This patch clears the L4 fields in that circumstance to prevent sending those garbage values as part of the upcall. Signed-off-by: Justin Pettit Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Signed-off-by: Greg Rose Signed-off-by: Justin Pettit --- datapath/flow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/datapath/flow.c b/datapath/flow.c index e3b0900..87d1f8e 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -472,6 +472,7 @@ static int key_extract_l3l4(struct sk_buff *skb, struct sw_flow_key *key) offset = nh->frag_off & htons(IP_OFFSET); if (offset) { key->ip.frag = OVS_FRAG_TYPE_LATER; + memset(&key->tp, 0, sizeof(key->tp)); return 0; } if (nh->frag_off & htons(IP_MF) || @@ -595,8 +596,11 @@ static int key_extract_l3l4(struct sk_buff *skb, struct sw_flow_key *key) return error; } - if (key->ip.frag == OVS_FRAG_TYPE_LATER) + if (key->ip.frag == OVS_FRAG_TYPE_LATER) { + memset(&key->tp, 0, sizeof(key->tp)); return 0; + } +#ifdef HAVE_SKB_GSO_UDP if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP) key->ip.frag = OVS_FRAG_TYPE_FIRST;