Received: by 10.213.65.68 with SMTP id h4csp2119987imn; Sun, 8 Apr 2018 20:11:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx480isQ0qxGRPgSOvhMoRHa8KzRH2qydELQnGxrtge0+u1PdV9rnl0WJDZhvc0LDgHR91AdU X-Received: by 2002:a17:902:8c8e:: with SMTP id t14-v6mr36889356plo.206.1523243514845; Sun, 08 Apr 2018 20:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243514; cv=none; d=google.com; s=arc-20160816; b=u6Xtvp9uIMSIeefM3REUBWCBhtOFqPstzSz45khl6YkpKnO1EAKAh5UhXjLb7EGjsg ErtrYTpf3tcPLUkhuto+ZgMCop8fD+Or+DJTdpaNZ6Op2A2j8lnNx/CFBbJc06jQNf0k WrbuGUfPIb+e4Vx0CTwX3JGole6ygBeXTUzt/zSxeOQ1WF3meleV2q8ec5sZ0K9kKSR0 AMRomGQ41cV9WVjQ0YwXteK6gA1nEBB89CvOsUZWqFVobiU+VDGaNcYV3mqvXfqaJoYW wA+ISFR/D0pYZ6uGlp84GiUa0+c6WUf41IIqxJsqRF26X+b7b5VUMbeiEGcMBotRzfvD OfRw== 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=RTgP62oIneAC7f1t9X7OeSjI5LWPLeAxRzTkq2qgoG0=; b=r3xD7NeRHsrJafj7bXRmbwNQ7NijAsPWG2WrPvfJNzv1bgC0bCkQtuaLlpz4QUb8mA UoC0f7X8k5KPZW2Y6Z2Dbo56lXPs6T4PAY7XOj6pEwcTQ6Xa9aapTyFCr1iYiQGGY2sb Y5bhXhPCAZyD+GCBUseRQUu5+Hs/+EwFV1gWHuvJPuIABGTyuZttPrTGxioMukQX2BM4 1wUmqd5yf+fGANRTKpngO+dfKlc4NgbKycEwlnqOhm2HmDWhTr87/hUjIxkRhu0Tlzjs lNZOD/lJA58l1OgGGkoylyZ61m+KvIcxEorg+BM0SZURLWaoq6aLxdUAj5XaDgXg2SAi AeaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=AGC5BHRA; 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 l4-v6si12905448plt.660.2018.04.08.20.11.18; Sun, 08 Apr 2018 20:11:54 -0700 (PDT) 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=AGC5BHRA; 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 S1757323AbeDIBae (ORCPT + 98 others); Sun, 8 Apr 2018 21:30:34 -0400 Received: from mail-sn1nam02on0133.outbound.protection.outlook.com ([104.47.36.133]:9440 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756626AbeDIAf6 (ORCPT ); Sun, 8 Apr 2018 20:35:58 -0400 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=RTgP62oIneAC7f1t9X7OeSjI5LWPLeAxRzTkq2qgoG0=; b=AGC5BHRADQ5Q4fwlwFwc9imRL8dV5GpTRz5v3BQsMYvQYYn0EV1fN3Auw58ZK5/OuEkvdRXPpO2EXqU/UkmLBM40XiwpyBYi3/m2LN2rbPZD5Q2P0z/ds627cJiT8N7gsZp8WMwKcXodrZsagX+UUcs7MTmUP7XAoUp1i6OYa/A= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0725.namprd21.prod.outlook.com (10.167.107.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:35:55 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:35:55 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Haishuang Yan , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 044/162] ip_tunnel: fix potential issue in ip_tunnel_rcv Thread-Topic: [PATCH AUTOSEL for 4.4 044/162] ip_tunnel: fix potential issue in ip_tunnel_rcv Thread-Index: AQHTz5mljPkSZTURlECEKPTzOMGCbQ== Date: Mon, 9 Apr 2018 00:28:14 +0000 Message-ID: <20180409002738.163941-44-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-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;DM5PR2101MB0725;7:aHNlkpLcCVh8J1zy1uY9SoEupeH666iVwXQ8usf9aUDtU5lFL9J9ig2g4ExRBmsNHdWHk8qPlKp3B3gnGuLFynffM+XB3wKJYX1uWVPln6lY41R+4vGBZm2nCQiFgWUmosVIl/kO4P+v7beEs0XegP6BVJLiYM+MxahDCeOdxj3mmcNue4HJYZTnBOlUzUicEW/TeBTk4H0eOxUNg33Ao8D7HwpvlPXn8Cm3ObO3nzpm8yp7OQ9aVaSEq5qOPuso;20:mitWHJFp5PHzQse9WW+w8sqN8w4Nbkq2u87EDJeBCwdAJZtgw7A1CsrmvtcwAk0nNrycdhGsLtSo7eNUF6nOim7KpnUWY3CXxXCwuXCprfw7/hXO5D2FKDF3maTla5A4WxqG0/fonRObMAJ3ydf1XxJn7vEMUQtNwCpRGDiB0NI= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 32be3e48-d0be-4fb5-e523-08d59db1db65 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0725; x-ms-traffictypediagnostic: DM5PR2101MB0725: 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)(211936372134217)(153496737603132); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0725;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0725; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(396003)(376002)(39380400002)(346002)(366004)(189003)(199004)(86612001)(575784001)(102836004)(5660300001)(14454004)(476003)(68736007)(11346002)(66066001)(446003)(99286004)(76176011)(486006)(10090500001)(3660700001)(110136005)(305945005)(106356001)(316002)(105586002)(3280700002)(3846002)(10290500003)(6116002)(22452003)(6506007)(2616005)(1076002)(7736002)(54906003)(478600001)(2900100001)(2501003)(5250100002)(8936002)(25786009)(81156014)(8676002)(6666003)(6436002)(4326008)(26005)(6512007)(6486002)(81166006)(107886003)(53936002)(2906002)(86362001)(186003)(97736004)(36756003)(72206003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0725;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nz3nDHwL4eh+iFf2SEKrwyXh5fAe5aCG9pSCb/cN1w2YPNtfx/jLh+Trp0wKTVARxyF9whTd6/8bP2pkZyojJ+BLE1fSeJdYlnNI1SeJSIwB454csepuKDYPbVXr1Qk47NHEFMZDdPwUKmcIV9VZndV8SLsho5hR6wJNGOiUUyuFyLsryL86GgaXAJs6YU4tTRHUSxWoFvaah1IpuoeJRmnEfCaP5TmzypgV/6mEa9HwXMvUJZZIbiZEfaDZ4kSsqTXz8TCt0rYwrdUh9fWbN8VBM1H5dGcz7Co8bhilzu5kYFgcpqN6PCRRseWl9I63PviR/8IjGiCDIl0vAzlzJkmIXxxuiRz+JwdfBZdj3JtL6gOdOuWbl6j+fNzEJjwutXRw8wa+IBs72Nbp6HHY3qH3JXc/BRk26QNOzV53PHw= 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: 32be3e48-d0be-4fb5-e523-08d59db1db65 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:28:14.6143 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0725 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haishuang Yan [ Upstream commit 469f87e158628fe66dcbbce9dd5e7b7acfe934a9 ] When ip_tunnel_rcv fails, the tun_dst won't be freed, so call dst_release to free it in error code path. Fixes: 2e15ea390e6f ("ip_gre: Add support to collect tunnel metadata.") Acked-by: Eric Dumazet Acked-by: Pravin B Shelar Tested-by: Zhang Shengju Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/ip_tunnel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 80e2d1b0c08c..f26749d450f7 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -439,6 +439,8 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_b= uff *skb, return 0; =20 drop: + if (tun_dst) + dst_release((struct dst_entry *)tun_dst); kfree_skb(skb); return 0; } --=20 2.15.1