Received: by 10.223.185.116 with SMTP id b49csp5967443wrg; Wed, 7 Mar 2018 22:52:06 -0800 (PST) X-Google-Smtp-Source: AG47ELt+4Ka+B7US9W5TzCsuIbdBzdwX08HUrUaR+q32aAM11560RllmUi78mig38TMyEgQ1g7FC X-Received: by 10.98.108.2 with SMTP id h2mr25123923pfc.43.1520491926083; Wed, 07 Mar 2018 22:52:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491926; cv=none; d=google.com; s=arc-20160816; b=uC0svNDSPz8RH5+bf1vw7WLv59yxnGZ91QuhxAoTMO06lbECXaqKTXC/gi3Za/6Ijj g8CEJz2iKrkIQGeSfixNOIwVHtRXSSi/nEDfMUrkoarsLjbxwKGpbGVFtdgtA7eSTOwI tYWWgT2iyO6Uf118seCix0qeWYjSoapuwPKW1bKpswMQPOrF6Kb5fqPJziEbubWvdRtN D7pYdEfGEO0mFQH5FlNx/84JcDoAZyrRi9jFTtPYZo/N9h95WKH8qpjexJ9SUUtELyCc hE3jD/KWDNgFr7wA19v1iA9/sl9jd/rWrL8QAbRhUQaTbzYV0P7TwsjpMIXu9mIbAJzr RSgQ== 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=D+/Z0cRVucYBrhPRdFtRKszMlyIWYz1bsRb6IQsIT5k=; b=QRS+Vnw07DAdS0YWN2vZ9++Z+IJBxm3bAWm0bbDpcO8Lk/nveRKa9z3V4ObGmKGPUL MJqwnHWg0kn/p7Tf7U9ygKVPpggKV97s3UUDMtgpke3kZibyzSMBlXr2/1O4cvSHwJSh FjRRSmeXCPH+MXj5LJpcI/CNR6wp61OFh5/Lbofg3K2Xv6po9ChgQwJQ9QxHmlXx9HMm +Ab+u0hgqfMt+kctawW1nreEABoJs+A7PxjAsoNzcoa9CcFw5NArzm6saAKPAm67vdyI o3V04RlYHLR5sY5nRHAg6eQGZ+VmFFMc4rXcz9X7DzT98thLRxxFyoytfKDuuS1Otk8W 9vHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PukEOARZ; 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 k131si12504943pgc.361.2018.03.07.22.51.51; Wed, 07 Mar 2018 22:52:06 -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=PukEOARZ; 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 S965271AbeCHGvB (ORCPT + 99 others); Thu, 8 Mar 2018 01:51:01 -0500 Received: from mail-by2nam03on0117.outbound.protection.outlook.com ([104.47.42.117]:8510 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965023AbeCHE6K (ORCPT ); Wed, 7 Mar 2018 23:58:10 -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=D+/Z0cRVucYBrhPRdFtRKszMlyIWYz1bsRb6IQsIT5k=; b=PukEOARZs2whVqpq3ZeEmtP6FWUsojdQeIpn+E1jRgpn9kyncVUG6SC16w5WWRXYfkRhrqZxB8z7+gfn+O1SgYIgqddFpAKLg4aRJI94c8vlINg/5WHnYrzCffjUerQ95MRMXJNRAkTWH/vqg01WXaeuX2GXabR3dMukzaPY1Hw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) 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:58:02 +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:58:02 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Loic Poulain , Marcel Holtmann , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 02/67] Bluetooth: btqcomsmd: Fix skb double free corruption Thread-Topic: [PATCH AUTOSEL for 4.14 02/67] Bluetooth: btqcomsmd: Fix skb double free corruption Thread-Index: AQHTtpn3tMkFzIjO7k6dDHfWXTkRJA== Date: Thu, 8 Mar 2018 04:57:32 +0000 Message-ID: <20180308045641.7814-2-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;DM5PR2101MB0936;20:bkP3XNSLyvxcqzT/qLdefO9/3Kfj6Me+4laeDdj9PupuDndSGU0p2+BqhpuzXBkCmhTvoDdBbUPlMm6r5jGrNy5yYlwcvljbTRKtQDnNgNTsBVjql24p27oSh7JTLoYNtG5UNRRzyfXU4E2VMF4kif0cmp48ZNbW7UV9M2E0jVc= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: f7a862e0-7d32-4d95-0f38-08d584b12c0f x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: 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); 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)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(346002)(376002)(199004)(189003)(478600001)(99286004)(575784001)(6506007)(59450400001)(3660700001)(36756003)(86362001)(54906003)(6116002)(110136005)(2950100002)(102836004)(1076002)(3846002)(6486002)(3280700002)(10090500001)(10290500003)(305945005)(72206003)(6436002)(6666003)(26005)(5250100002)(2906002)(186003)(2501003)(105586002)(76176011)(66066001)(7736002)(68736007)(25786009)(6512007)(106356001)(86612001)(8936002)(107886003)(81166006)(2900100001)(5660300001)(4326008)(81156014)(53936002)(14454004)(97736004)(316002)(22452003)(8676002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0936;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: a5Eu53pdAizaCSB1AfKIJIqCVzxOqoyHXcY1jS/xP91sNmMtvpvIaX+GSJu5BLZK4cu19DpeDJ3z0tmcpPxsFkI4lXNtdeOamfUDgc1Dz5e10uiDE6lciEbeFRXrrUq2Z/h4pJLCXMCQV/5c6cZ+YCGcaKaQothpOXGKUcSjw4pBIVOZqlQ8MTSXcZOkohjQtPeMa8FeLgDYEFg5Gz7y065JyWwPxMgUxf+i2S9kw6dUJFfanwGem4YEGaxL5wcn+vamOt49dRMAyD4ImKhHB1kf4pe8mI/VI5dqGpNq0ovTy52DqHSlYsn/BdBmy8+ZRijhJUvkhYqqY2F4vwH4hA== 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: f7a862e0-7d32-4d95-0f38-08d584b12c0f X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:32.2583 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Loic Poulain [ Upstream commit 67b8fbead4685b36d290a0ef91c6ddffc4920ec9 ] In case of hci send frame failure, skb is still owned by the caller (hci_core) and then should not be freed. This fixes crash on dragonboard-410c when sending SCO packet. skb is freed by both btqcomsmd and hci_core. Fixes: 1511cc750c3d ("Bluetooth: Introduce Qualcomm WCNSS SMD based HCI dri= ver") Signed-off-by: Loic Poulain Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btqcomsmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index bd810d01538a..093fd096f0c8 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -86,7 +86,8 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk= _buff *skb) break; } =20 - kfree_skb(skb); + if (!ret) + kfree_skb(skb); =20 return ret; } --=20 2.14.1