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 ECD07175D53 for ; Mon, 8 Dec 2025 00:47:54 +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=1765154875; cv=none; b=YSUs64MOPto7ayAeMCeXb63wvD0VCQq9xgtJI4AyYdPZ6vqSsbwQGpoZ+c2gfLNx6Gr30FeTQPh2N6NzEV6GKkk7o1Cd2PGqGvcyMLOnSewZoB7z6gWsH74n3k43s7gM+a3oA0P8EoUiA6sZq76c1pz3HwCbY8fJNeDZy/IpwUs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765154875; c=relaxed/simple; bh=4pleH4ZUEz+ZzUkkNgpzt8YOkSKADQahQiWpZTokZiM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PH/NIjkNaibM4ZgrGyePMhKd8zN0AvK3wdaZcHE4CM9fZ03tWneNJMyqQmanfUBztxmXx1ZLVs2/+MlUnKb5wJ/y/rmCpZbgCMsSr2gMPhHXMNgobwBaOCdgYZxe3FmsAwZDsjp43gyNGwVuhCqJzGtLU1/pNbCd7uLxc8UufPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2cak+c1K; 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="2cak+c1K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57B15C4CEFB; Mon, 8 Dec 2025 00:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765154874; bh=4pleH4ZUEz+ZzUkkNgpzt8YOkSKADQahQiWpZTokZiM=; h=From:To:Cc:Subject:Date:Reply-To:From; b=2cak+c1KzbCOlXezFzZPIFab5u7oabLze2kd78QMM5eSA3/00xblqg6TJA1ipzpWT flyX4c9ifRgTqze286sfuRONwbfdIOiYbBgFQ+t9GW0+WaKN/aSLzTEA3jF8MMvfLk qh5Yoo+ubOfUy5in+Ezlnw7KMuSPzPjzKEaG3nnI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40308: Bluetooth: bcsp: receive data only if registered Date: Mon, 8 Dec 2025 09:47:32 +0900 Message-ID: <2025120821-CVE-2025-40308-0613@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3466; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=iyjFzHAjyaEFYysZZlau31SBbSt+RRvOO5QYl0KpHys=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlmCpKvwk+f5f0+09XoOmv51U+CM7hWrDibod/eJ/Hbq 6KuZuuJjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIBG6GBTO+ZUzsWnV6BpuR 5LPUL26tbQey4xjmRxnfn3b9pp1iuL7PxdiCb6pOni87AA== 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: bcsp: receive data only if registered Currently, bcsp_recv() can be called even when the BCSP protocol has not been registered. This leads to a NULL pointer dereference, as shown in the following stack trace: KASAN: null-ptr-deref in range [0x0000000000000108-0x000000000000010f] RIP: 0010:bcsp_recv+0x13d/0x1740 drivers/bluetooth/hci_bcsp.c:590 Call Trace: hci_uart_tty_receive+0x194/0x220 drivers/bluetooth/hci_ldisc.c:627 tiocsti+0x23c/0x2c0 drivers/tty/tty_io.c:2290 tty_ioctl+0x626/0xde0 drivers/tty/tty_io.c:2706 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f To prevent this, ensure that the HCI_UART_REGISTERED flag is set before processing received data. If the protocol is not registered, return -EUNATCH. The Linux kernel CVE team has assigned CVE-2025-40308 to this issue. Affected and fixed versions =========================== Fixed in 5.4.302 with commit 39a7d40314b6288cfa2d13269275e9247a7a055a Fixed in 5.10.247 with commit 164586725b47f9d61912e6bf17dbaffeff11710b Fixed in 5.15.197 with commit b65ca9708bfbf47d8b7bd44b7c574bd16798e9c9 Fixed in 6.1.159 with commit 8b892dbef3887dbe9afdc7176d1a5fd90e1636aa Fixed in 6.6.117 with commit 799cd62cbcc3f12ee04b33ef390ff7d41c37d671 Fixed in 6.12.58 with commit b420a4c7f915fc1c94ad1f6ca740acc046d94334 Fixed in 6.17.8 with commit 55c1519fca830f59a10bbf9aa8209c87b06cf7bc Fixed in 6.18 with commit ca94b2b036c22556c3a66f1b80f490882deef7a6 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-40308 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/hci_bcsp.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/39a7d40314b6288cfa2d13269275e9247a7a055a https://git.kernel.org/stable/c/164586725b47f9d61912e6bf17dbaffeff11710b https://git.kernel.org/stable/c/b65ca9708bfbf47d8b7bd44b7c574bd16798e9c9 https://git.kernel.org/stable/c/8b892dbef3887dbe9afdc7176d1a5fd90e1636aa https://git.kernel.org/stable/c/799cd62cbcc3f12ee04b33ef390ff7d41c37d671 https://git.kernel.org/stable/c/b420a4c7f915fc1c94ad1f6ca740acc046d94334 https://git.kernel.org/stable/c/55c1519fca830f59a10bbf9aa8209c87b06cf7bc https://git.kernel.org/stable/c/ca94b2b036c22556c3a66f1b80f490882deef7a6