From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3088C4321E for ; Thu, 17 Mar 2022 12:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235254AbiCQM6s (ORCPT ); Thu, 17 Mar 2022 08:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234466AbiCQMxO (ORCPT ); Thu, 17 Mar 2022 08:53:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E3E21D12F1; Thu, 17 Mar 2022 05:51:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 99AF2B81E5C; Thu, 17 Mar 2022 12:51:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5709C340E9; Thu, 17 Mar 2022 12:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647521465; bh=6tcnReq4dlKG8UQNN1H5WqTssEeBvARoDbZQTqK+57o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rdXpn4qvUyTPq//TO03egpWjoNYwtyb00fbkw+UL8n0qavIwjNGcTPxoMEmzRpUy9 Mnb/it9COg3TXEjyUKe9+JE3NxWfPAgpTCB2xSSTPfo3stt6zGR6/rhvYjVSyFoxlp brGYUNBP+tjXQXGMWynhj978BrwXYZAdQG+DpupM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.15 14/25] Bluetooth: hci_core: Fix leaking sent_cmd skb Date: Thu, 17 Mar 2022 13:46:01 +0100 Message-Id: <20220317124526.716389346@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317124526.308079100@linuxfoundation.org> References: <20220317124526.308079100@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luiz Augusto von Dentz [ Upstream commit dd3b1dc3dd050f1f47cd13e300732852414270f8 ] sent_cmd memory is not freed before freeing hci_dev causing it to leak it contents. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/hci_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 53f1b08017aa..c67390367cc2 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -4083,6 +4083,7 @@ void hci_release_dev(struct hci_dev *hdev) hci_dev_unlock(hdev); ida_simple_remove(&hci_index_ida, hdev->id); + kfree_skb(hdev->sent_cmd); kfree(hdev); } EXPORT_SYMBOL(hci_release_dev); -- 2.34.1