Received: by 10.213.65.68 with SMTP id h4csp2113669imn; Sun, 8 Apr 2018 20:03:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx48dXnqnhJySggdnPmS8ozy/oadbRnWLz5fEUGoAvjOgw85y00NEzmedzRnE1p7Jxz3Nh9G5 X-Received: by 2002:a17:902:6709:: with SMTP id f9-v6mr5468218plk.159.1523243023116; Sun, 08 Apr 2018 20:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243023; cv=none; d=google.com; s=arc-20160816; b=cd1I1kOb/NxwVbC/AuNlwrdl80iWOwmbfqdkiH3U/WyLNIid6v5L1+WAJ6fJZdmAYA VSvhHTjyulZ+H3A41i2kt5t5l8hKzz5Q0z9/g2gfqJXw5/CXe7GmRgUKIJsMn+iiVYeV /rNqoKOtxHUO/c9HshQhoQBgasgorI+os7LBOlnuwqIujaTLTFKCFKvmssrUzNJkilcf 1Xv5m7jDDXbShn0nR0Zb5vZvOpPBYZFUfeqQQyF/WPNeHY2kqwS9tYW3ghqkV96HSwAE K9c7x8/yETcDPQQfc+uDJuGNdxJWgOYtw6ox0BUosIy0NuTqbYLMiwvoeo0Wi2ZKt41/ yOXw== 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=mmZw6pgAFCRHQj9Os/1WSu2eBNAr3RQ2lb8M1GYgsIc=; b=l6wbjfSaSY2Cm9HWvryAQ8NI7tjNfTig1RwowSXT295YUWWmwVo3wIsxuKuouJL6AZ XsOfkGDR98ewM/aAPLX0wqV0ayE8DoW76CvHHbFCABtKjm3Zm22gk+IvnvwMxmcQPxto 7xbzwlPsa85MTY2Dgi38J5jNeaSP4ibjRAUcxFXjRoKsO4E62CM2azvRFtoNBYxb27MZ uQw3Hr/exBbyYVz1qhaoR6jwunG9azWtrL0s1vGLnfzFgR6LaVc3P/8dPs/ZD+F2A3xc OSDB4WQgfu69+UPe3vzF9+088yrB7wpqRY2XbPHo8ctKFkM5e7J21Tmlg0uZ4otsmXFj gNWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Q0iOBl9u; 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 32-v6si15878608pla.348.2018.04.08.20.03.06; Sun, 08 Apr 2018 20:03:43 -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=Q0iOBl9u; 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 S1755906AbeDIA2p (ORCPT + 99 others); Sun, 8 Apr 2018 20:28:45 -0400 Received: from mail-dm3nam03on0110.outbound.protection.outlook.com ([104.47.41.110]:12595 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755895AbeDIA2l (ORCPT ); Sun, 8 Apr 2018 20:28:41 -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=mmZw6pgAFCRHQj9Os/1WSu2eBNAr3RQ2lb8M1GYgsIc=; b=Q0iOBl9uF3Qcp2+COdEYAIPe7GuYJL7ZuO3ZjSg5wNB4inal4ECnZ1qybfGya0T6ixn+jLSTwhfC5BPW/xfzq0b8/7B0WAbehNg8oB4mXmLC9WeqOW5o4myU3dkl48J6Yf4kWjhOYH0V0rQP86mDAdzS7wUQ27sDwS8XoFxCefI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0807.namprd21.prod.outlook.com (10.167.110.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:28:35 +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:28:35 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Haishuang Yan , Alexei Starovoitov , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 086/293] ip6_tunnel: fix potential issue in __ip6_tnl_rcv Thread-Topic: [PATCH AUTOSEL for 4.9 086/293] ip6_tunnel: fix potential issue in __ip6_tnl_rcv Thread-Index: AQHTz5kOdGQ1v/Z+WEKRJ1lDK2Y0IA== Date: Mon, 9 Apr 2018 00:24:01 +0000 Message-ID: <20180409002239.163177-86-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0807;7:gZ4IiBGSRzRkfyaStwkDiQQNFRxz+YlHG4L8atx7QRE1Kw/yF/IGHXJ4Fr3GU4visvKc82r2xzgjOx3W3/7Veunnxth39I2uP2/JsU6aIj6gtoZFkDKUbPy63GZqarcyG1/iyn/LSVkD3Nv4+5N4iMjCx9G3R44Aoc8rRFyZ/nfUH3xAYIdkQciKvH+VZudRSdJaNkYpu8xq5FHdFoycRQBeyZXJo1OZUgYTsH/DfA7i7IRN1aA117suEMDDM7i0;20:dKLlZi9/5A1VzjMfHcwH3pFOlfKTozEr/dmI8thkPE2tq+GFWJv/N00Ea5FmwldZlAQhI5R5chvj1XcY/d/JJQV7nbJgeCEfZa8h+P2FqINIGHKpvGjv/VxsD16XG6cUe9E6Ws6SCDh06Waq/bCB57mURBw9zD0MR8mJe5f+9yE= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 56d2fdbf-73d1-4d42-ca34-08d59db0d4a7 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0807; x-ms-traffictypediagnostic: DM5PR2101MB0807: 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)(67672495146484); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231221)(944501327)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0807;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0807; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(39380400002)(39860400002)(396003)(366004)(376002)(346002)(199004)(189003)(14454004)(4326008)(54906003)(25786009)(53936002)(2900100001)(1076002)(3280700002)(6486002)(186003)(2616005)(68736007)(110136005)(11346002)(10090500001)(6116002)(107886003)(3846002)(36756003)(8676002)(72206003)(22452003)(66066001)(26005)(6512007)(478600001)(3660700001)(81156014)(86362001)(81166006)(86612001)(7736002)(305945005)(8936002)(10290500003)(6436002)(105586002)(6666003)(316002)(76176011)(5660300001)(476003)(106356001)(2906002)(6506007)(446003)(2501003)(99286004)(5250100002)(486006)(102836004)(97736004)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0807;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: obFimwJZjlfjLVXEgx+yUBl7ivve8fyPwA2KI0OaTovaeLICUfUYBkZdwMOMY02GszC5YbYjFpNSahAhPLwrQXepLzneGmhjzYtrGdFBZ8+U+2DGvBQ5qpqHKnFUw81Q3/j9SLnBtSvvOXBtdgtcFoG/SRnAzuj9nKrG2CFo8QqOBK/sKcfh2AWNVb1oP8lZQuf2D3n4reW7h4zKx89RrU4xUjJigHzXIEpyjVdiWctY4pAR1Dx/+uGbv0n9YQGHtxM4R68BnAAdbIlH39JX986lvUI4cbd6QAoAipUstlyfctU1uC9OEsMPuKSGR27X+OkNKi57qUwPqVE+RcguoKg1uxtfY152Og02S5Nn1/aLMeRZZFnOZ6iphNB5mo/pDtq1i3ikSrbaV3TmW1WHdvz7fw4MhQrCgvr9Idh1gCY= 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: 56d2fdbf-73d1-4d42-ca34-08d59db0d4a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:01.1593 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0807 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haishuang Yan [ Upstream commit f1925ca50deb48eddafc01bc12c2a17bfbf54425 ] When __ip6_tnl_rcv fails, the tun_dst won't be freed, so call dst_release to free it in error code path. Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") CC: Alexei Starovoitov Tested-by: Zhang Shengju Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/ip6_tunnel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index a2fcf7bdb597..5a009807ac2f 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -859,6 +859,8 @@ static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct= sk_buff *skb, return 0; =20 drop: + if (tun_dst) + dst_release((struct dst_entry *)tun_dst); kfree_skb(skb); return 0; } --=20 2.15.1