From patchwork Thu Mar 8 04:57:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130956 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6116263lja; Wed, 7 Mar 2018 22:51:05 -0800 (PST) X-Google-Smtp-Source: AG47ELsKFvfqRGfBZfT92PFzOJewIw8EhZmvqYf/wWSOPReXBfulxuiRYV5SdDyDfJoB2qXRuYUQ X-Received: by 10.101.74.135 with SMTP id b7mr20418698pgu.260.1520491865504; Wed, 07 Mar 2018 22:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491865; cv=none; d=google.com; s=arc-20160816; b=LTMRNjWhQv0qluDp2FWV7OtH/dKUi04fKMAI9ROLKT8H380J5RS8ykHh46aNzsNI1k DmWO9xYVg7naLaXPvu3E+RpFKb3ltFvFOg2tCzowemYBshLEpGympRGTZJRtU6R0vKUb JrwxpRmhGy92G0/8+nzsIDdr6Dpof3vsgjIm4AODSCzDHtjIruaRAeC74DmeAikXMezU UET4sSxDZQOb23VZO8xFPTq5qtSZfrul2JhrFghGTF9XYZL1K+XJ1PYPo4B9NwWyaSnw OFLyuS9nutH01IvMStpFsDGKoWGFki/pNT0leN+1/fiykjeYhEjwYceZ4VXq6rUH2q/e Nyxg== 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 l3si15258083pfb.377.2018.03.07.22.51.05; Wed, 07 Mar 2018 22:51:05 -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 S965040AbeCHGvB (ORCPT + 28 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 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 driver") 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(-) -- 2.14.1 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; } - kfree_skb(skb); + if (!ret) + kfree_skb(skb); return ret; }