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 B5FDF25A331 for ; Fri, 2 May 2025 15:58:51 +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=1746201531; cv=none; b=tOR0IDsAEsMGpqCIA8c/R/y67+VuDmINJygPWz07Q9Ya5l9dUMDLrnFLdehjnU/f/0le/1/gdguSAJQGMBLh9349r8afU+1iASSk120yWSKU5JgyOOnMdTmcutE6EznB6pgT1lMgjc9LPZgJ6dmsJAOf3Hx7hkjQrcs9xAvr+O8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746201531; c=relaxed/simple; bh=OE/+a1ox7PwYe05HT/dovPu1xYvZRYS+UJGE/mABumA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UMzI6jXl/C0L07G0EikC8uylBmPVsqTIon1NFPe6gg9JxNyK7gTHFrU2+lJLJ6veuHEt1GS2RqNabU9fNc0maW213hqpD2Lw64gOLOk1gFMRzAUl8l3D/U8D+de7fZK0u5IZkxLOqf1Fxc9dJ+ch7RFsbfNZ+9Lfti2mBRclSr4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mLiPZAVS; 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="mLiPZAVS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 424A2C4CEE4; Fri, 2 May 2025 15:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746201531; bh=OE/+a1ox7PwYe05HT/dovPu1xYvZRYS+UJGE/mABumA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=mLiPZAVSyZfmwmOPaWPO/Ohz6cwf6G1eoZzvQfcH+seFneasLcVJxJpY+IR/OjCAn qspR2eamApH7syEUTxJkeFRfdQ9Z3FJCMm4ANaUj2iDOakBwZ5nkPavQAx7SkPBIZM kNki/GxCoidgRVM+e2+XlgOpINnkddPxMyio2kgk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53046: Bluetooth: Fix race condition in hci_cmd_sync_clear Date: Fri, 2 May 2025 17:55:11 +0200 Message-ID: <2025050204-CVE-2023-53046-f1fc@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=3850; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=TEa75MYM1D1g/fy/ZU0FcpvHk0hM3Bfmko2toQeap58=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkir26UNy42rZabpXpjbVej1NnXZ+ZWb9637U6Hp8/fk zMv7ji5syOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAm8v4fw4LTl9V8ypfIT4l+ d/LY2YV93sk9rvwMC44LZeoGxq0W1/YP9A+oMXK4I6/ZDwA= 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: Fix race condition in hci_cmd_sync_clear There is a potential race condition in hci_cmd_sync_work and hci_cmd_sync_clear, and could lead to use-after-free. For instance, hci_cmd_sync_work is added to the 'req_workqueue' after cancel_work_sync The entry of 'cmd_sync_work_list' may be freed in hci_cmd_sync_clear, and causing kernel panic when it is used in 'hci_cmd_sync_work'. Here's the call trace: dump_stack_lvl+0x49/0x63 print_report.cold+0x5e/0x5d3 ? hci_cmd_sync_work+0x282/0x320 kasan_report+0xaa/0x120 ? hci_cmd_sync_work+0x282/0x320 __asan_report_load8_noabort+0x14/0x20 hci_cmd_sync_work+0x282/0x320 process_one_work+0x77b/0x11c0 ? _raw_spin_lock_irq+0x8e/0xf0 worker_thread+0x544/0x1180 ? poll_idle+0x1e0/0x1e0 kthread+0x285/0x320 ? process_one_work+0x11c0/0x11c0 ? kthread_complete_and_exit+0x30/0x30 ret_from_fork+0x22/0x30 Allocated by task 266: kasan_save_stack+0x26/0x50 __kasan_kmalloc+0xae/0xe0 kmem_cache_alloc_trace+0x191/0x350 hci_cmd_sync_queue+0x97/0x2b0 hci_update_passive_scan+0x176/0x1d0 le_conn_complete_evt+0x1b5/0x1a00 hci_le_conn_complete_evt+0x234/0x340 hci_le_meta_evt+0x231/0x4e0 hci_event_packet+0x4c5/0xf00 hci_rx_work+0x37d/0x880 process_one_work+0x77b/0x11c0 worker_thread+0x544/0x1180 kthread+0x285/0x320 ret_from_fork+0x22/0x30 Freed by task 269: kasan_save_stack+0x26/0x50 kasan_set_track+0x25/0x40 kasan_set_free_info+0x24/0x40 ____kasan_slab_free+0x176/0x1c0 __kasan_slab_free+0x12/0x20 slab_free_freelist_hook+0x95/0x1a0 kfree+0xba/0x2f0 hci_cmd_sync_clear+0x14c/0x210 hci_unregister_dev+0xff/0x440 vhci_release+0x7b/0xf0 __fput+0x1f3/0x970 ____fput+0xe/0x20 task_work_run+0xd4/0x160 do_exit+0x8b0/0x22a0 do_group_exit+0xba/0x2a0 get_signal+0x1e4a/0x25b0 arch_do_signal_or_restart+0x93/0x1f80 exit_to_user_mode_prepare+0xf5/0x1a0 syscall_exit_to_user_mode+0x26/0x50 ret_from_fork+0x15/0x30 The Linux kernel CVE team has assigned CVE-2023-53046 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 6a98e3836fa2077b169f10a35c2ca9952d53f987 and fixed in 6.1.22 with commit 608901a77c945ac15dea23f6098c9882ef19d9f0 Issue introduced in 5.17 with commit 6a98e3836fa2077b169f10a35c2ca9952d53f987 and fixed in 6.2.9 with commit be586211a3ab40a4f4ca60450e0d31606afc55ec Issue introduced in 5.17 with commit 6a98e3836fa2077b169f10a35c2ca9952d53f987 and fixed in 6.3 with commit 1c66bee492a5fe00ae3fe890bb693bfc99f994c6 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-2023-53046 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: net/bluetooth/hci_sync.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/608901a77c945ac15dea23f6098c9882ef19d9f0 https://git.kernel.org/stable/c/be586211a3ab40a4f4ca60450e0d31606afc55ec https://git.kernel.org/stable/c/1c66bee492a5fe00ae3fe890bb693bfc99f994c6