Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1343643pxp; Thu, 17 Mar 2022 07:42:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9grfuw7MGapob29/W8L1gqVWm4p+72KiM9P/T1HuwnbFcghir2/3xq+Q4dAQUTqBICZ7Q X-Received: by 2002:a17:90b:905:b0:1c6:9747:1939 with SMTP id bo5-20020a17090b090500b001c697471939mr2017313pjb.37.1647528163936; Thu, 17 Mar 2022 07:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647528163; cv=none; d=google.com; s=arc-20160816; b=OEPuVzDR8lj685PyNxUEX5HNP9G5Z/qTZ3biBTsTOnnk3L8LWLulJ43AuCxXlimR/M qsRjZJf8tpVU6IzA32sBcmta6RCCNWH246glV1sF+nVVJT3xOLLhAB+laPXGV32twL6i dqlN5D8RQH9+qdU/tz4utAReBBFTX5iH1n30ArmBn3611hBBSPpaJfOHBlP870WxdQnZ yKdKgtmLVF4lqfLIpsYzrGgoJ76XCHYsIsrvXMgtmN46MYUUuCtcnTv9E9NHk6vG+Uqd u2vwoJgv68zViC/002kuKWUgNEhdVyDhJZFj/MToLuea4lnoWHfyOux5rcZHAq4iwuIB jNJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fsiaYm3DEs626sSJNiq/ySnEkj+bQjdOc4Ft4G+dzxQ=; b=s1B10Bt/bidRZgtiX86ybSstzFOwXxyCb10QI0ZLZTLwf7V3fm1EmCRDYSx0pPemA5 dxBaqkr1La4vhWVoP7MfYoa0oZSnOixEIkX1rZQ7cMsybIoOefgwdS3mXLTZTksFKfjP z/htILIy/13Bti3sQr0qn15bTsM90A9CQqlDPZE35y+1ofbKqxCZM4DYkOVQdMuwi1Ox QCfKmocZ/5j1gjiFazkfIMs9ch0OdAB2KOsf6/uTxG9o1xiNqv1WucQJaU4mnh1Hp0Ra kclBEHXiXybyyl2QUzwWtjy8utN6i+bdu9gZ0e12vDJieBWTC4IVEoEwkZ7jMzESsd6y rSrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kfcuWKul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a63fc0f000000b003816043ee45si2472955pgi.58.2022.03.17.07.42.29; Thu, 17 Mar 2022 07:42:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kfcuWKul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234573AbiCQM5u (ORCPT + 99 others); Thu, 17 Mar 2022 08:57:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234980AbiCQMyQ (ORCPT ); Thu, 17 Mar 2022 08:54:16 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4E884ED7; Thu, 17 Mar 2022 05:52:57 -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 sin.source.kernel.org (Postfix) with ESMTPS id B79EACE2340; Thu, 17 Mar 2022 12:52:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88EEFC340E9; Thu, 17 Mar 2022 12:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647521574; bh=94Eezw0rkaghiNp0XtbPiQ+zQlAXCbVMeFdXKfkMh5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kfcuWKulK/k7zppHtfWWgVbplKFllYL1wLJnZH2Eb4eRfd0io5K8tdW1gnZM5FjTp sf43wxmAUPEBV1e5iZnvgMXNr3bDUsxPPS8j11jjlnunZYpYe7uj2ZV4+JzMvtfTpb 7/ZsCanMteiHq8qXgJXkfg5Q8TPW+Qv7CklLkaq8= 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.16 15/28] Bluetooth: hci_core: Fix leaking sent_cmd skb Date: Thu, 17 Mar 2022 13:46:06 +0100 Message-Id: <20220317124527.200558031@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317124526.768423926@linuxfoundation.org> References: <20220317124526.768423926@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 6c00ce302f09..1c8fb27b155a 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3969,6 +3969,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