Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp49094imu; Thu, 8 Nov 2018 14:33:37 -0800 (PST) X-Google-Smtp-Source: AJdET5fgiJTiBZVaFtE4QRRFGLnKDU8HpdvDtGQmEdjd+Rsb57VwK19SjtBGIx0qMF4ckQxzNlqf X-Received: by 2002:a63:9b11:: with SMTP id r17mr5372959pgd.416.1541716417593; Thu, 08 Nov 2018 14:33:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716417; cv=none; d=google.com; s=arc-20160816; b=WTBlYrDluUB07lfFX6Z+LGNwltJMF2Xd6wdw+D3o6Y+vjF8i52I9LSuQ1/oO5PcOLs 9u6s7AgkHAcJvNVliSAMiU8TZa98qprQAi7u3Pq0cox72pXn0FI/TFLAmT3npTM7g2Hg ephWInuU8u49vvDYaqGaGK/ILZVzxQf82wskjANYrAJbY/7Gm8wJ9Uh2S6EZ8M+vsPtj +kmtkhfam9wntRhtp8/3XPg9L3XH8r6EzhLWUZFndWZHYiMhUV5Oqp2nzlT7kE0oxtdu jUOM/piwi2FMz7v9Ruyb6BNKugg2XtdGpITHxbHtinncD76434zggZtg+KPKx071DYt+ HSvA== 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=Fsj0v+qZH/bcYK0HcYbzCllMxzU7G693HGRMg36zb10=; b=1IzGKYqOtKmHZ9SX070oVRDB0NcONRkPXZXdRga96rBBXYy73OILSgAoxWTsR8/M6q bFsv5B0dWYEKzHbGaAdfA2oYO/5UJ24TJtillM+32zUgz4Nqx/gTDE6/o4MK+TLZALTy QcXMUbBQ55XZvmHFFlDVxzZikYYjgLoyjQQ0ahRpMBOgum9saK29/38afYAimFdFk53N ASMq4q9tpCZ6zZkU8okLK7JLmYYzMNRPwyvld5emGoiYBgVeJTzYz9q97bBsidqSYQ/o 53WwlhGZ9ew8aMBvXcjfGgF9lDIwUbX9xaMjf2zLAAVPRi/oJFxFYAHT9rrTxjx2QN39 EIzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZS7TfYhn; 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 d8-v6si5264916pgh.45.2018.11.08.14.33.22; Thu, 08 Nov 2018 14:33:37 -0800 (PST) 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=ZS7TfYhn; 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 S1729907AbeKIIKk (ORCPT + 99 others); Fri, 9 Nov 2018 03:10:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:55784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbeKIHh3 (ORCPT ); Fri, 9 Nov 2018 02:37:29 -0500 Received: from localhost (unknown [208.72.13.198]) (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 90F3320818; Thu, 8 Nov 2018 22:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714400; bh=S0CNCWfSjsRdsBymq8tpcGU1DcMCmeY34XOBZhtfV+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZS7TfYhn0Or24XWWKHFEtPezeAfv38Yi44TacsECgAS81/L/nje01zguk9LfQ9NjM sbVk2z4Ua+/GkDQymbiXlaDmpFlliuPs//doQPyhEkhmakOOW/E2V/wDEXRn1p1xgM pVb82uCrmE8rZAluvc7tBHnf1QjZvzzPJHqyKi0Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Duyck , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 061/114] gro: Allow tunnel stacking in the case of FOU/GUE Date: Thu, 8 Nov 2018 13:51:16 -0800 Message-Id: <20181108215106.615048628@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c3483384ee511ee2af40b4076366cd82a6a47b86 ] This patch should fix the issues seen with a recent fix to prevent tunnel-in-tunnel frames from being generated with GRO. The fix itself is correct for now as long as we do not add any devices that support NETIF_F_GSO_GRE_CSUM. When such a device is added it could have the potential to mess things up due to the fact that the outer transport header points to the outer UDP header and not the GRE header as would be expected. Fixes: fac8e0f579695 ("tunnels: Don't apply GRO to multiple layers of encapsulation.") Signed-off-by: Alexander Duyck Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/fou.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 08d8ee124538..d83888bc33d3 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c @@ -195,6 +195,14 @@ static struct sk_buff **fou_gro_receive(struct sk_buff **head, u8 proto = NAPI_GRO_CB(skb)->proto; const struct net_offload **offloads; + /* We can clear the encap_mark for FOU as we are essentially doing + * one of two possible things. We are either adding an L4 tunnel + * header to the outer L3 tunnel header, or we are are simply + * treating the GRE tunnel header as though it is a UDP protocol + * specific header such as VXLAN or GENEVE. + */ + NAPI_GRO_CB(skb)->encap_mark = 0; + rcu_read_lock(); offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; ops = rcu_dereference(offloads[proto]); @@ -354,6 +362,14 @@ static struct sk_buff **gue_gro_receive(struct sk_buff **head, } } + /* We can clear the encap_mark for GUE as we are essentially doing + * one of two possible things. We are either adding an L4 tunnel + * header to the outer L3 tunnel header, or we are are simply + * treating the GRE tunnel header as though it is a UDP protocol + * specific header such as VXLAN or GENEVE. + */ + NAPI_GRO_CB(skb)->encap_mark = 0; + rcu_read_lock(); offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; ops = rcu_dereference(offloads[guehdr->proto_ctype]); -- 2.17.1