From mboxrd@z Thu Jan 1 00:00:00 1970 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 33EB42139C6 for ; Wed, 15 Jan 2025 13:06:37 +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=1736946397; cv=none; b=kVzSZsTwdMKs3dm1IGnB3YVDEjQhSHD7Y+Ar0sS75T6QXixbgr/FHky4SQ9INq3ay8uFoeduMQCF1Ddv4cUZ3uUg1xMD3EyoYn6EeixJ7qz0Z5gDZJz6Nng/OJmROjb05fItXDm5c+OleIUJVc0G0WuY6zKiuzT8WcfwpSZ+MVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736946397; c=relaxed/simple; bh=kZw3VUkMLLBA4jNeoswt0Vddf/flH1vKJc3/i8C6Z/Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OGi33v2XxBWYZ8SBT85CgxnAjFR1x9Hb4M4s+CyWn9WFiLSv02RFn/uWpZhptORbJSrkEOgGuDlBClrQY8xcM55y4pHwNfx2drXkPkmZ6UO3M1WHnGfc/jnm/+nsGddIV/cR0YFQiK+S9JMk2QNLkSxjzw0n+KN5unSaJwUa7CQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kSJiiZY1; 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="kSJiiZY1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C977C4CEDF; Wed, 15 Jan 2025 13:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736946397; bh=kZw3VUkMLLBA4jNeoswt0Vddf/flH1vKJc3/i8C6Z/Q=; h=From:To:Cc:Subject:Date:Reply-to:From; b=kSJiiZY1w1o7YZOhkj0WmkK65DE/YusNaOWDMGaG0nSUTYO7ZzFzWLQz3HUv5qCfj /tWm3PW08IOr17ccaxbn8OC1jFV+Mbuw8poq1F2JPTf3kyke3JrwLsFesE72d5cEZM bRZKi+PahxOh3qAfRBbR7GmB8RQnRqYPxogEkwjM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57894: Bluetooth: hci_core: Fix sleeping function called from invalid context Date: Wed, 15 Jan 2025 14:06:17 +0100 Message-ID: <2025011513-CVE-2024-57894-fbfe@gregkh> X-Mailer: git-send-email 2.48.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=4524; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=kZw3VUkMLLBA4jNeoswt0Vddf/flH1vKJc3/i8C6Z/Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDOntm47NNi5Nyr28WKfYvDlF5OSbA1ZHapfs5rKU6jZo2 Flz4tPGjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiI8kaGufI7c8STYw82J/yf XpjprTr9rXW7CMP8iFMlz2J+c68uO1h/mUPZZNEXhc+nAA== 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_core: Fix sleeping function called from invalid context This reworks hci_cb_list to not use mutex hci_cb_list_lock to avoid bugs like the bellow: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:585 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5070, name: kworker/u9:2 preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 4 locks held by kworker/u9:2/5070: #0: ffff888015be3948 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3229 [inline] #0: ffff888015be3948 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_scheduled_works+0x8e0/0x1770 kernel/workqueue.c:3335 #1: ffffc90003b6fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3230 [inline] #1: ffffc90003b6fd00 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_scheduled_works+0x91b/0x1770 kernel/workqueue.c:3335 #2: ffff8880665d0078 (&hdev->lock){+.+.}-{3:3}, at: hci_le_create_big_complete_evt+0xcf/0xae0 net/bluetooth/hci_event.c:6914 #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline] #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline] #3: ffffffff8e132020 (rcu_read_lock){....}-{1:2}, at: hci_le_create_big_complete_evt+0xdb/0xae0 net/bluetooth/hci_event.c:6915 CPU: 0 PID: 5070 Comm: kworker/u9:2 Not tainted 6.8.0-syzkaller-08073-g480e035fc4c7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 __might_resched+0x5d4/0x780 kernel/sched/core.c:10187 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0xc1/0xd70 kernel/locking/mutex.c:752 hci_connect_cfm include/net/bluetooth/hci_core.h:2004 [inline] hci_le_create_big_complete_evt+0x3d9/0xae0 net/bluetooth/hci_event.c:6939 hci_event_func net/bluetooth/hci_event.c:7514 [inline] hci_event_packet+0xa53/0x1540 net/bluetooth/hci_event.c:7569 hci_rx_work+0x3e8/0xca0 net/bluetooth/hci_core.c:4171 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 The Linux kernel CVE team has assigned CVE-2024-57894 to this issue. Affected and fixed versions =========================== Fixed in 6.1.124 with commit 028a68886ead0764f4b26adfcaebf9f1955e76ea Fixed in 6.6.70 with commit bef333418368c58690b501894324c09124e4614f Fixed in 6.12.9 with commit 4a31c018bfe4de84c0741aadd2c913a2490b186d Fixed in 6.13-rc3 with commit 4d94f05558271654670d18c26c912da0c1c15549 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-57894 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: include/net/bluetooth/hci_core.h net/bluetooth/hci_core.c net/bluetooth/iso.c net/bluetooth/l2cap_core.c net/bluetooth/rfcomm/core.c net/bluetooth/sco.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/028a68886ead0764f4b26adfcaebf9f1955e76ea https://git.kernel.org/stable/c/bef333418368c58690b501894324c09124e4614f https://git.kernel.org/stable/c/4a31c018bfe4de84c0741aadd2c913a2490b186d https://git.kernel.org/stable/c/4d94f05558271654670d18c26c912da0c1c15549