Received: by 10.223.185.116 with SMTP id b49csp5958191wrg; Wed, 7 Mar 2018 22:39:07 -0800 (PST) X-Google-Smtp-Source: AG47ELuf85LPxGgi4uBww+3WrOvMSLSb8M7EVMy1b866+lkB4iOmUA5hdGnjSBHmPMwOqv8UCXTz X-Received: by 10.99.189.82 with SMTP id d18mr20394161pgp.172.1520491147687; Wed, 07 Mar 2018 22:39:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491147; cv=none; d=google.com; s=arc-20160816; b=UKhH4A8LS+gtpcLD8YsDjjNHxHb2GOcyi/RXDUtUe7xR6JVSa9VlElcrgnplPZpu+p Dy/KV08DlI3Cjxf9NGqBfjBCgFXQmmyntUcEvMgt+HKqmfvBkLhYn4Qhy71s+YCAEzbS XKesiPMT0hOXns29WNJq1o9lpSn1elLs6FITVvu/QcklUOM46ML2SKo+a3PmHqOiiOFW AUTgIEFkJUwDne19iTNUs5/O0AhY/3ZqRTXXyVMCNHkPnLL3uQ2Q9N7Ii2cIQjuuZ7+L Qg8OWNTvPO32yuOBM4iBoYwIaNblwwBTVTiXCTXIi7Z6sdLsRKkaHItoh2oM5jYdLRLc My4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=l/XKBbQ1fg2fkvwa95+xc+TvKHHj2yezM9sGSeMV6fE=; b=t2wbdo5UdIQYtC3mQ1Qw4C9OjhM63Vx/iVn5mP08tCyM/iEjlF7T7SGw/b6ohm94vP Pmzh5NUOjhpQNx6KqjGZ7+do/X4hx/+VdCQFCYDhTzY/ST//f0i+sHaV3U/lMGIH4tJQ QqKORurhOw2Aqz6KV4szFI9RW5ubrg6XymrfDc5Nu8ARB7dXn7niOtWJ5AsDAOkcbre0 4MXKB3qEW3u1aiy5FVanprXKlVfWhKMvjSTjwbvVFHPIZEnOS8Zoawm1SWQ065Tudyoa xVoAu8GSEIATZo2eVWrJ9/8kJfbHoRT8FTaAZVS4PQKu3ddjb9FgZpBNz3Pg+7rfkqwK 1ITg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JzqY8Br9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63-v6si14091119plb.356.2018.03.07.22.38.53; Wed, 07 Mar 2018 22:39:07 -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=@microsoft.com header.s=selector1 header.b=JzqY8Br9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755520AbeCHGhf (ORCPT + 99 others); Thu, 8 Mar 2018 01:37:35 -0500 Received: from mail-sn1nam01on0106.outbound.protection.outlook.com ([104.47.32.106]:14491 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965347AbeCHE7O (ORCPT ); Wed, 7 Mar 2018 23:59:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l/XKBbQ1fg2fkvwa95+xc+TvKHHj2yezM9sGSeMV6fE=; b=JzqY8Br9iRYJ/t/uxlunuWehYFRX62GSo3AgXxC+6KVuvbQldrgYc3gL0CmVs7Yc4uiMh028Q0cmbWSzfdWOzOGXbDjZ+nuUp43e+uNsRW5n5kuH94td1tSK65P0NDRCTQQ+mvSPbULmSSAQz8e0dKHwM3ruiltRFHxYwjpLZDM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1015.namprd21.prod.outlook.com (52.132.133.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:59:10 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:59:10 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Haishuang Yan , William Tu , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 54/67] ip_gre: fix error path when erspan_rcv failed Thread-Topic: [PATCH AUTOSEL for 4.14 54/67] ip_gre: fix error path when erspan_rcv failed Thread-Index: AQHTtpoFriZbuBrTPUSsS9TW3Xhhpg== Date: Thu, 8 Mar 2018 04:57:55 +0000 Message-ID: <20180308045641.7814-54-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1015;20:LDaoKeRuNumMhQPdMvlWHhjOj/gDn1sK0MFAFGFyHnuoLyZw2E9hWSLHEcnGSnFPVfeok0+QK+C8+TjRJqW9tK9KNJasiVH/5o7BXUB3AAQheuLhqT/2oL94QoUHlRLtZ6l+2eXlcbLPeXNWP4iuLLxPufdOvs9JwomArTDmyh4= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 81a266cc-9cf6-4540-0ac7-08d584b15457 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1015; x-ms-traffictypediagnostic: DM5PR2101MB1015: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(173505980823694)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1015;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1015; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(366004)(39860400002)(39380400002)(346002)(189003)(199004)(6116002)(53936002)(1076002)(107886003)(3846002)(3660700001)(10090500001)(6666003)(2950100002)(2906002)(6512007)(99286004)(8936002)(6486002)(76176011)(6506007)(68736007)(316002)(110136005)(81156014)(81166006)(8676002)(54906003)(3280700002)(2900100001)(6436002)(97736004)(72206003)(25786009)(10290500003)(86612001)(4326008)(305945005)(7736002)(66066001)(22452003)(478600001)(5660300001)(39060400002)(86362001)(575784001)(14454004)(106356001)(36756003)(102836004)(5250100002)(105586002)(26005)(2501003)(186003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1015;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: SMbe6mIXi+X5OIjMOUcjdwyBNFSZN45G6/zTSpTnAQjXoxxmCVd7HHqd8Acvj862jRzfKVKX8yr417Rg9Nc3UqkqPNrOWI3Xl8gmxg16X4Zo02bDIwCqYrBsuz78YcGQpx4C6CPRRHysj8FGc3acjvNDweF7U5YI55OapXzGWwQPu4xaipa9eC3mA+SU5z0DcrzQhj6xeQgRTi5WmQXlecYJ7PxJZgqmigxyGab/NrIwX8pIvBvaNS5rk+nmmZfX0cl3QNSgABawr9MmKvAtATbgt/hiqmUJnhqM2EnBz9ezvUONZTnhG1OIqQ2RYginqP6xX4vTT975/bw/tw8nqg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81a266cc-9cf6-4540-0ac7-08d584b15457 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:55.2754 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1015 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haishuang Yan [ Upstream commit dd8d5b8c5b22e31079b259b8bfb686f1fac1080a ] When erspan_rcv call return PACKET_REJECT, we shoudn't call ipgre_rcv to process packets again, instead send icmp unreachable message in error path. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Acked-by: William Tu Cc: William Tu Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/ip_gre.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 045331204097..e0cc6a38b701 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -408,11 +408,13 @@ static int gre_rcv(struct sk_buff *skb) if (unlikely(tpi.proto =3D=3D htons(ETH_P_ERSPAN))) { if (erspan_rcv(skb, &tpi, hdr_len) =3D=3D PACKET_RCVD) return 0; + goto out; } =20 if (ipgre_rcv(skb, &tpi, hdr_len) =3D=3D PACKET_RCVD) return 0; =20 +out: icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); drop: kfree_skb(skb); --=20 2.14.1