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 015CD1CF7A6 for ; Mon, 21 Oct 2024 19:39:56 +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=1729539597; cv=none; b=Fpc9yaz8vfPMeHgVocSiAsx01Zwygi4ML+tFpEC+WWEEsOHSGYInF16iMfPwRJ7fjcNkWq+QWPnP5K+C/FMUBmdfoOMIIQMF8mA+xjTaz3nlNNtsuhVGiM+RM2g1+FLYAOdtyDsgAIquup2cIlYc1EIVIgoSRMD65uFmt+rq2f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729539597; c=relaxed/simple; bh=GbqFiBKLV7IZsg5JmPTZy4pp6pnanzR9cqvxb4MsSb0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=f/iFlWdRLWpHVMjPDhYMbvFHKShM0SMVlitNhf6VN8XPsedeEu1ygcqPvApuKaRILimT7XnOiWwT4Oi7Ysl16roviQssXVred4cvafxcsEqqEqRdBxOu9sPM4mv2rRu1S0r7Sx+L8mgX2jK05mc7oQvmUvTm5/CGWv8zWVUoOLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qGIZzYOw; 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="qGIZzYOw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42350C4CEC7; Mon, 21 Oct 2024 19:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729539596; bh=GbqFiBKLV7IZsg5JmPTZy4pp6pnanzR9cqvxb4MsSb0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=qGIZzYOwr8lYznRKN46PgUWMyi4N4Zs/hE5hdqhcaU9xrBwwoMR8HcYuNtVbCBnxl c+64U63r4JM8AU/QIBJKL8ucd0Zl7b25GltnslBfIodMdJ0likc53TjpbfOZKwhvg9 nqhKJABYLEye6DmlN+bUJZIhzB/VQvOMJKwN9ROQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50029: Bluetooth: hci_conn: Fix UAF in hci_enhanced_setup_sync Date: Mon, 21 Oct 2024 21:39:35 +0200 Message-ID: <2024102130-CVE-2024-50029-8df2@gregkh> X-Mailer: git-send-email 2.47.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=3956; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GbqFiBKLV7IZsg5JmPTZy4pp6pnanzR9cqvxb4MsSb0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOliaz9t2J6iY3uhRMn7tFWZNt/+zcxzowWd1q47atOu4 bFOUGJRRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExk8w2G+el9Gw22dHWrzdoV WBjw+PNsr572MIYFB1OFWy5XXU9cuMYpcO33OcubJQ6kAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: Bluetooth: hci_conn: Fix UAF in hci_enhanced_setup_sync This checks if the ACL connection remains valid as it could be destroyed while hci_enhanced_setup_sync is pending on cmd_sync leading to the following trace: BUG: KASAN: slab-use-after-free in hci_enhanced_setup_sync+0x91b/0xa60 Read of size 1 at addr ffff888002328ffd by task kworker/u5:2/37 CPU: 0 UID: 0 PID: 37 Comm: kworker/u5:2 Not tainted 6.11.0-rc6-01300-g810be445d8d6 #7099 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-2.fc40 04/01/2014 Workqueue: hci0 hci_cmd_sync_work Call Trace: dump_stack_lvl+0x5d/0x80 ? hci_enhanced_setup_sync+0x91b/0xa60 print_report+0x152/0x4c0 ? hci_enhanced_setup_sync+0x91b/0xa60 ? __virt_addr_valid+0x1fa/0x420 ? hci_enhanced_setup_sync+0x91b/0xa60 kasan_report+0xda/0x1b0 ? hci_enhanced_setup_sync+0x91b/0xa60 hci_enhanced_setup_sync+0x91b/0xa60 ? __pfx_hci_enhanced_setup_sync+0x10/0x10 ? __pfx___mutex_lock+0x10/0x10 hci_cmd_sync_work+0x1c2/0x330 process_one_work+0x7d9/0x1360 ? __pfx_lock_acquire+0x10/0x10 ? __pfx_process_one_work+0x10/0x10 ? assign_work+0x167/0x240 worker_thread+0x5b7/0xf60 ? __kthread_parkme+0xac/0x1c0 ? __pfx_worker_thread+0x10/0x10 ? __pfx_worker_thread+0x10/0x10 kthread+0x293/0x360 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2f/0x70 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Allocated by task 34: kasan_save_stack+0x30/0x50 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x8f/0xa0 __hci_conn_add+0x187/0x17d0 hci_connect_sco+0x2e1/0xb90 sco_sock_connect+0x2a2/0xb80 __sys_connect+0x227/0x2a0 __x64_sys_connect+0x6d/0xb0 do_syscall_64+0x71/0x140 entry_SYSCALL_64_after_hwframe+0x76/0x7e Freed by task 37: kasan_save_stack+0x30/0x50 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x101/0x160 kfree+0xd0/0x250 device_release+0x9a/0x210 kobject_put+0x151/0x280 hci_conn_del+0x448/0xbf0 hci_abort_conn_sync+0x46f/0x980 hci_cmd_sync_work+0x1c2/0x330 process_one_work+0x7d9/0x1360 worker_thread+0x5b7/0xf60 kthread+0x293/0x360 ret_from_fork+0x2f/0x70 ret_from_fork_asm+0x1a/0x30 The Linux kernel CVE team has assigned CVE-2024-50029 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit e07a06b4eb41 and fixed in 6.6.57 with commit 867639300759 Issue introduced in 6.1 with commit e07a06b4eb41 and fixed in 6.11.4 with commit 98ccd44002d8 Issue introduced in 6.1 with commit e07a06b4eb41 and fixed in 6.12-rc3 with commit 18fd04ad856d 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-2024-50029 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_conn.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/867639300759e3e1c5b1e1a5ff89231f263a32a7 https://git.kernel.org/stable/c/98ccd44002d88cbf4edfc4480df532a3da5a013e https://git.kernel.org/stable/c/18fd04ad856df07733f5bb07e7f7168e7443d393