Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D822F25DAF0 for ; Tue, 20 May 2025 15:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747754618; cv=none; b=cTvQLVtL+1XAD1RnuKHqvctJ4RtOvPso9ABh1QF1lutHstX58aDnsXDR83diVwwf8Kh+tSpOrIH+1/omOXUdTfLYvKj0qA1UcGVHE2Kmsl4xJPlAv81LPmAtpqBHDX8gO4lp/bm7IBdhwqJwTwvenPGEgYgLru5bfEE/8T7XJrw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747754618; c=relaxed/simple; bh=3+7GmTZBRO0heXDPCBuo0ekO7dMu3SQsGpST7iUhrK4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=poxHNaMtbnvV2J3bwQdbCqBdJRit+QnEQdjdHrqySp2E/DiTZtR1mYj0NTN+YQ2VdzLlFV2P+W9zseLvTZskZxkOBDWwttNuD1V358vod69dX/TjI3MAHJ6vl4h00r02+qYYeAZ0Hhn5NxpKV1VHpqpAkEaMRqmTFUhYXHeGB5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=x/29jLol; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="x/29jLol" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FDEFC4CEE9; Tue, 20 May 2025 15:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747754618; bh=3+7GmTZBRO0heXDPCBuo0ekO7dMu3SQsGpST7iUhrK4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=x/29jLolJ+Ao0sLXbBZBSXrSeKFcVmPB/PodWe/yJA8498FuyVjn91JM53wHR4HR7 eYpNANGbA1wL8fvpcp+ij1AzLS4UetLz6glDfuVcuZvIRcQQF2VdWH9wbb3DVsvgXK G6QOfplQ+HLqypHIw7jtJmWWvhKGlc+Q8iGjwTt4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37918: Bluetooth: btusb: avoid NULL pointer dereference in skb_dequeue() Date: Tue, 20 May 2025 17:22:15 +0200 Message-ID: <2025052001-CVE-2025-37918-db24@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3511; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=qZMiMtqo0W/aeDBxkTK5uF1AMaSnyOZo/zV3SOyOWSQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk686SSY5p4r9WYX42riyntq3uTXiGu9DqiZ95UvfVxP sa/fPw6YlkYBJkYZMUUWb5s4zm6v+KQopeh7WmYOaxMIEMYuDgFYCKTAhnmF+7mN4g6FPjpCNuR PmFH6d7dGzZJMcz3P6rieU0v4NLZsN9/1JJ0m+bmKFwCAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: Bluetooth: btusb: avoid NULL pointer dereference in skb_dequeue() A NULL pointer dereference can occur in skb_dequeue() when processing a QCA firmware crash dump on WCN7851 (0489:e0f3). [ 93.672166] Bluetooth: hci0: ACL memdump size(589824) [ 93.672475] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 93.672517] Workqueue: hci0 hci_devcd_rx [bluetooth] [ 93.672598] RIP: 0010:skb_dequeue+0x50/0x80 The issue stems from handle_dump_pkt_qca() returning 0 even when a dump packet is successfully processed. This is because it incorrectly forwards the return value of hci_devcd_init() (which returns 0 on success). As a result, the caller (btusb_recv_acl_qca() or btusb_recv_evt_qca()) assumes the packet was not handled and passes it to hci_recv_frame(), leading to premature kfree() of the skb. Later, hci_devcd_rx() attempts to dequeue the same skb from the dump queue, resulting in a NULL pointer dereference. Fix this by: 1. Making handle_dump_pkt_qca() return 0 on success and negative errno on failure, consistent with kernel conventions. 2. Splitting dump packet detection into separate functions for ACL and event packets for better structure and readability. This ensures dump packets are properly identified and consumed, avoiding double handling and preventing NULL pointer access. The Linux kernel CVE team has assigned CVE-2025-37918 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 20981ce2d5a5f79d17da1ace3a93df7b3c6ba3d6 and fixed in 6.6.90 with commit 2e8d44ebaa7babdd5c5ab50ca275826e241920d6 Issue introduced in 6.4 with commit 20981ce2d5a5f79d17da1ace3a93df7b3c6ba3d6 and fixed in 6.12.28 with commit b70b41591ec48c78ec6a885e1f57bfc4029e5e13 Issue introduced in 6.4 with commit 20981ce2d5a5f79d17da1ace3a93df7b3c6ba3d6 and fixed in 6.14.6 with commit 8563d9fabd8a4b726ba7acab4737c438bf11a059 Issue introduced in 6.4 with commit 20981ce2d5a5f79d17da1ace3a93df7b3c6ba3d6 and fixed in 6.15-rc5 with commit 0317b033abcd1d8dd2798f0e2de5e84543d0bd22 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-37918 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/bluetooth/btusb.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/2e8d44ebaa7babdd5c5ab50ca275826e241920d6 https://git.kernel.org/stable/c/b70b41591ec48c78ec6a885e1f57bfc4029e5e13 https://git.kernel.org/stable/c/8563d9fabd8a4b726ba7acab4737c438bf11a059 https://git.kernel.org/stable/c/0317b033abcd1d8dd2798f0e2de5e84543d0bd22