Received: by 10.213.65.68 with SMTP id h4csp2113684imn; Sun, 8 Apr 2018 20:03:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49d7QQ2gClD1q9/LL8Sw3gRzoIZ4nMr/J4YGgDh+InV7OKY+a3xkmfUaFzAc5XszH9HmUQa X-Received: by 2002:a17:902:f24:: with SMTP id 33-v6mr36831899ply.242.1523243024177; Sun, 08 Apr 2018 20:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243024; cv=none; d=google.com; s=arc-20160816; b=GT0b0w5QP1dLdRkISuYybBxrQZf9NRbGaBDNsMjNWlXJGESfXcDvqk8UPn9JLdvhva fPfN5huVe8PDOrdU3J6qAj2llWdVUTt+d4eLqEG+6rrr3d5XgaeScxtqjc2NaePg/JYb 6eH39YToRV0niW5Z/rbeWgM8+B72N3leuVj9dEuJAUCXESdnZWV7KdiuSb5LYau4LgNd pBtM6T2egj9J9ZuWXcVbDhwu8Jp5kLkSROyzLNgkvQuy+O7zPAVKgAsqsEimzWb7R3j6 x8t8FI/OqYt1ZR5ho2tZId1CiM7znPAWX4FD8ohSzD9B0dJff7nYqnmpXIZXfldWifI/ WxHQ== 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=6PJe70N0eEaHYtcq/jxVcmnIkhgH5FDHBOL00zuwDsw=; b=OX1iJz630BOVIEtDSAqO/nm8aEB3k6rprq2EPKpZC+xn1CI+iC/52GWleIZYb3l9xr u4Ed0mo6l9tSTBzkIwSJt0ZM6GlckiWfve1I77Prfpz8m6QJOT3C0lZBtyWWJ1aNVR5l VpeQSs5ukTH4WhyessTUhMEYJSUpLN8DfYhthby1aKAg8ClpjWZfTA8O8zKM9VMUCE+3 ZmOI2vSZcJfVYNs1WYaALojQuhrpjJU35pj50J2mIYaTj8m/annBTubHR0/y3r8LiTx1 jbOkhr8RW+6EgW5Hj7Hqrqff8DkEo0Rs7Jus//uE7hTcLFAGRfcnny+n19l9OCRkYrqX FPww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=m/luptnC; 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 n24si11590927pff.382.2018.04.08.20.03.07; Sun, 08 Apr 2018 20:03:44 -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=m/luptnC; 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 S1755921AbeDIA2r (ORCPT + 99 others); Sun, 8 Apr 2018 20:28:47 -0400 Received: from mail-bn3nam01on0096.outbound.protection.outlook.com ([104.47.33.96]:38912 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754337AbeDIA2l (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=6PJe70N0eEaHYtcq/jxVcmnIkhgH5FDHBOL00zuwDsw=; b=m/luptnC74mWhB2LuMdj0bJKcGH14H7OlerE2R20EcxCDtudru6dSmz2V75ADSIBh/eQ0fUhYBHMVh6WyT6i1J8NueFkQAbPYwsVmgWSYw9lfIE5T0n3JSbpTbRviLdCcbXPWwE7xNCCNNCKWAnwJqvesAK++LBVF8KquwtTq7U= 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:34 +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:34 +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.9 085/293] ip_tunnel: fix potential issue in ip_tunnel_rcv Thread-Topic: [PATCH AUTOSEL for 4.9 085/293] ip_tunnel: fix potential issue in ip_tunnel_rcv Thread-Index: AQHTz5kOTo2hW1SFRESfKeiKN7G8Aw== Date: Mon, 9 Apr 2018 00:24:00 +0000 Message-ID: <20180409002239.163177-85-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:wZq4bqrmAbHEQB3NOnKRl7YhIvfv50qvQJP8GOweEyJtfK8Pu3OpojExUIYMvPuv5pimI9gPQLiKXP3y2YrpO/17RyQiANqGEL4Zn65S8DOgpArbkkprQm3jvXkwLjG4HIPpW1KsUx9voX9tCnD8DoCyeCZ1ERPX9KNd3IeaWFpzJqiFEsTcaVM0BGMaRhWOiyLbfG0BC8Cr43//NFBZjoWs2aM5xrEORhRBJmmGRZ1TYLkCD1v+kl3s4hblvmrI;20:IvSsixOOFmIIZJ8lEbYeVYAWq5zVdL/CgpwBMHZcVxA0yzG7CoN+8BR+NUpOd9J1jUhRmIw4s9QrcUQivmjJVKCKLPjL48RrIELssVHu4JvCdm+4szAWQkka/VAGJH4ilRFCz8nBcAPKFRCEW6y2JQoZEDh+XPMRBdtW8323oZk= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 4a3faa4f-89e3-45b1-a70a-08d59db0d443 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)(211936372134217)(153496737603132); 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)(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)(575784001)(76176011)(5660300001)(476003)(106356001)(2906002)(6506007)(446003)(2501003)(99286004)(5250100002)(486006)(102836004)(97736004)(22906009)(217873001);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: HFWJbsX3FMgkg8QEMfc7qgNf5pCmzNFivCt5woaROs+yZLc0Yc3xSi9IAZU1KDjEwqkLztdClQ78+9E0KQfEXVwvfALySYyK+q/OiuU4ggK/mLjDQuVY50QrcPreLFaDmOSL09KuLsSjUQyB/Sb6uwmFLF94Tr28we+nhBXW1CD7iZP6AxDjGXskSv+KfegaGUDGTzKI3axAb91WpV0Ve8knCNYpG5kOu/v+IFpuu5hiIXg4X6uodfCCJjpcCS6uLRToml7u801FitQMwH80V/9e1z0BnCRReUho7FF5qQ0/evRavXlliNOeikuz2aP4J2QnzM+9mFQ50Up3BoDK/0j++6jkDpzsNwh3w5we+35I2CIryLbotxwEIYVo8z36PdlRwMU+W+4PBX/c3XtMcurpDLNFhwbc1bA+dDwgH64= 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: 4a3faa4f-89e3-45b1-a70a-08d59db0d443 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:00.3312 (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 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 96536a0d6e2d..a665eaab5db2 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