From patchwork Thu Jun 28 23:00:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 936543 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="MbQKASiw"; 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 41GwHn24xZz9s0w for ; Fri, 29 Jun 2018 09:01:09 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 60FDFD1D; Thu, 28 Jun 2018 23:01:06 +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 EE8AECDD for ; Thu, 28 Jun 2018 23:01:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B075B17E for ; Thu, 28 Jun 2018 23:01:04 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id e11-v6so3107612pgq.0 for ; Thu, 28 Jun 2018 16:01:04 -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; bh=98oscEn3KjXWt5gmNyHX67o2vrmWMPEJCfuIgizrru4=; b=MbQKASiwn7r/R23Qs5Q6ycgXucifsqRucBaxiYyie11pPDKkyVoV1ZGADZtWDP+HVm xpzDtf9GvU8p0/hrwa+PQUdKhXOE4rgtCoOZSt2RGhRvBrWS+xTp8rGt3UEltlmQs0Pp T4PFSC8e4X8OyNMHKtclua9pPsxZ/1Be31jyBkRdxWjiYQNN5LuimcLiGVJuwrFo0Df/ 0poVwTbqj4hW50N8pypENYgT1XLF4vKt6jj8y0tEs982WMC0B5j++nnkEVqpJqivFjaD ZxadrhaO9Y2b2Foisxw3xmCBsqyUZ28rb2fUqaHQujKA67Lk3gYl655E95iGOdSY0Tgu hU4g== 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; bh=98oscEn3KjXWt5gmNyHX67o2vrmWMPEJCfuIgizrru4=; b=La5Jbbw1Sa41I04zinF/JGiiCH8gx2BGt4ni1XM5OmWJN+dvXYrprxgldefApOY0DQ +FuA9lczR1OE7IKN6GkaHO1iXnieOsk+Kqlru6txlo2B/RWHh6gkHCsO08YxiJpBau5p X0imgkvzlH2JQq2hA76AGi35AtVoHuSJ2W9p+i7CX/cviryCqFUuX7eoon/AnpNs47L7 OSc8t0ZbwVFqTPsSV6nXG7xZUQwxNZEsfqR/efWa69YPCRYihPQxpVppkRDKJWVvQxMi MrQ5NdeQwDIA8MJt24fBcdgceIK5QDr2sBZTJpGzK+JMVnHIBeJLeXYj0JUO/8c0ajpd 2IPA== X-Gm-Message-State: APt69E2ZPNSLQC0Tpn4t5eZ0Bj5KDVzl+ZEuzrSSOd5ALeKBk2JWXnFs mjmjvIcr7nTtDdEw4mH+584Bng== X-Google-Smtp-Source: ADUXVKLBATci1pw+jH8O/Q7xHvDVPehVYTo5B9xeQRK9j3aZ07oilflC6YqLXfbGmhBnhanRvW24TA== X-Received: by 2002:a63:b34e:: with SMTP id x14-v6mr10354315pgt.243.1530226863706; Thu, 28 Jun 2018 16:01:03 -0700 (PDT) Received: from gizo.domain ([97.115.155.245]) by smtp.gmail.com with ESMTPSA id d132-v6sm14350880pga.10.2018.06.28.16.01.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 16:01:02 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 28 Jun 2018 16:00:59 -0700 Message-Id: <1530226860-26032-1-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 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 1/2] compat: Fix gre header bug 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 Commit 436d36db introduced a bug into the gre header build for gre and ip gre type tunnels. __vlan_hwaccel_push_inside does not check whether the vlan tag is even present. So check first and avoid padding space for a vlan tag that isn't present. Fixes: 436d36db ("compat: Fixups for newer kernels") Signed-off-by: Greg Rose Acked-by: William Tu --- datapath/linux/compat/ip_gre.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index ac9fb8b..df0217e 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -552,10 +552,12 @@ netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb) goto err_free_rt; } - skb = __vlan_hwaccel_push_inside(skb); - if (unlikely(!skb)) { - err = -ENOMEM; - goto err_free_rt; + if (skb_vlan_tag_present(skb)) { + skb = __vlan_hwaccel_push_inside(skb); + if (unlikely(!skb)) { + err = -ENOMEM; + goto err_free_rt; + } } /* Push Tunnel header. */ From patchwork Thu Jun 28 23:01:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 936545 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="ty2iQZv6"; 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 41GwJL6MdMz9s01 for ; Fri, 29 Jun 2018 09:01:38 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 56791D2E; Thu, 28 Jun 2018 23:01:09 +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 30098CF9 for ; Thu, 28 Jun 2018 23:01:06 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id ED5A319B for ; Thu, 28 Jun 2018 23:01:05 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id s21-v6so3272533pfm.6 for ; Thu, 28 Jun 2018 16:01:05 -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=X0e0U4t1kwK3asRoKfl+/26CIKDa7a/dLQxYXuVu/lE=; b=ty2iQZv6FbmMxz8EdzHMrZpnxo+tAPUn4CIn+A/76icy+QzXa54BZ6jjsWklNfPD8t k3iNHncndFT56BoISb3UfuJr0YjImi/zWigyWcvgBONXqtdeL1vQAICD+gaN7S8eCqo5 lWCAHoHqY5N5iCNXkdvkQh2OG6byZhjlGLur+AMkoMDCgxAHfs3Vv0q2MRp110K7hjD/ MEQBppckH8U8WGzGOOo57goBEgTr6v1uRS4SHkk81zxZ+2LU5R8naGmC6PmoTd9HkYAg wXdn9ThRi5i3PO6ZS8cgvwq23Oe53CaimG0QkJUbKAiDflXxpaa1ZW+G7+khZAkjLo5v GwBA== 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=X0e0U4t1kwK3asRoKfl+/26CIKDa7a/dLQxYXuVu/lE=; b=XJjBLUdIIziwrpu/gZClGfWT21+SQrgY/b3ls7fD0wJqUffJxQ0TnqkiO+Vns3tuCH DZTWV5+TeFlgNM1KJTChn8R3IgmEYdsB2f8ESVWG1Hd1DUS8YKCnNaPho0c170nuK0qW pfvzual0L5q4PAvNm8NGaD8v6vBvTu9+vIqblWxOFDiy5hHWfbe88ipSytVVEgCqj2Ki WXDs75s8OorsRrXAhm7EY6BV5BSAxhCsRm8SfY/o4TxZ53ozy4Nn8A9ZZLQX00B+j2lq KGBRhCOg8tknmvbdROqtQ44TP6DzJ4yShzhEjNV5UJ/O/jiiKrDvtQIpyfA1wcD+CvmC otAw== X-Gm-Message-State: APt69E14vSR9DyZ4wXFeIcGRw6u67oDI4pCdjUParzttvnx84doMpcdL M+rmSF7Pmn7Vhhqp2iT9ABaW/Q== X-Google-Smtp-Source: ADUXVKIkGi3AjFHa9gBhkKZLIjE4yRtSwaTjj8aFbPzmuUT3H8pH+JTu3rlLTN7IlApRTpbCpzUQDA== X-Received: by 2002:a65:45cc:: with SMTP id m12-v6mr10410093pgr.160.1530226865204; Thu, 28 Jun 2018 16:01:05 -0700 (PDT) Received: from gizo.domain ([97.115.155.245]) by smtp.gmail.com with ESMTPSA id d132-v6sm14350880pga.10.2018.06.28.16.01.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 16:01:04 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 28 Jun 2018 16:01:00 -0700 Message-Id: <1530226860-26032-2-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530226860-26032-1-git-send-email-gvrose8192@gmail.com> References: <1530226860-26032-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 2/2] datapath: Ignore key in ip_tunnel_lookup 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 The key value is always zero in ip_tunnel_lookup() for all OVS tunnels but in received packets it is set. Just ignore it for the ip_tunnel_lookup() in the same manner as erspan_rcv(). Fixes: 8e53509c ("gre: introduce native tunnel support for ERSPAN") Signed-off-by: Greg Rose --- datapath/linux/compat/ip_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index df0217e..5670bdf 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -272,7 +272,7 @@ static int __ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi, iph = ip_hdr(skb); tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, - iph->saddr, iph->daddr, tpi->key); + iph->saddr, iph->daddr, 0); if (tunnel) { if (__iptunnel_pull_header(skb, hdr_len, tpi->proto,