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 1D5D128B4FC for ; Thu, 10 Jul 2025 07:42:20 +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=1752133341; cv=none; b=cKEJeHdN6tbaMqTLmXJtRTLw8nkIw15WWRGR33uEMOYkfq95x+ig3juOIDxVIGK6C0tDCrkf+kFCsP+ZUdlq+JZb1snigsdo/NrsP3vfgLxP9M7ZY6S/UzFSt6HrHSlLLYeZvdjEcwPh7g75jtfAgCjkZlmzctxR2d2uFfDnHcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752133341; c=relaxed/simple; bh=rCo8zOOo0r11MprhdCQWIqVTyjRUsXqeWyRUXcY6r1Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bd2LVQw7AtO02O7CRKQec2dUrcvKOSeojaCC2kJO1F8i/k3Tl8dbSJx2fk2PK7jZKLx7HZGOxx/BMHbrNFL62Go26xbIW51ZefB714ZCrTz0T3gfvjPHb1SDWy9GWiEa1of+Wisp4DilQ9VhJeUjuGaglB71Yg6bItwYz8rLOWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VL2MXtbO; 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="VL2MXtbO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41F27C4AF09; Thu, 10 Jul 2025 07:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752133340; bh=rCo8zOOo0r11MprhdCQWIqVTyjRUsXqeWyRUXcY6r1Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VL2MXtbOiebib1jXuVpKg3fqmfri8HFOanLldXtfFUmdZNZKDJsioKc954I+jUMMd jVlJFY0CaOp8LAtF8h4P+liZHOAgItJxboZBmp6o+vzARYwJP57OfvbmrsjjVa7YAL dPucfJ2mDF73sTuKfMW7vgZHnaqvrjpT7SIFCDTc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38268: usb: typec: tcpm: move tcpm_queue_vdm_unlocked to asynchronous work Date: Thu, 10 Jul 2025 09:42:09 +0200 Message-ID: <2025071007-CVE-2025-38268-3f41@gregkh> X-Mailer: git-send-email 2.50.1 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=4938; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=tdlBuQ0KWLw6UPIzSNPoli0EdnM82ySOLD+L7h6dX+Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDBn5eecvx4TaqSe5KK3fYLPw/1ndV2KrVpVv/aquU8Xe+ HJC8fuJHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRbzMYFpxdJ3HXnvXYqyLH yIx5Oz7fNlFxtWKYKzVnu+m9h5fiHJ8fVY5nWfOl8FzQNwA= 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: usb: typec: tcpm: move tcpm_queue_vdm_unlocked to asynchronous work A state check was previously added to tcpm_queue_vdm_unlocked to prevent a deadlock where the DisplayPort Alt Mode driver would be executing work and attempting to grab the tcpm_lock while the TCPM was holding the lock and attempting to unregister the altmode, blocking on the altmode driver's cancel_work_sync call. Because the state check isn't protected, there is a small window where the Alt Mode driver could determine that the TCPM is in a ready state and attempt to grab the lock while the TCPM grabs the lock and changes the TCPM state to one that causes the deadlock. The callstack is provided below: [110121.667392][ C7] Call trace: [110121.667396][ C7] __switch_to+0x174/0x338 [110121.667406][ C7] __schedule+0x608/0x9f0 [110121.667414][ C7] schedule+0x7c/0xe8 [110121.667423][ C7] kernfs_drain+0xb0/0x114 [110121.667431][ C7] __kernfs_remove+0x16c/0x20c [110121.667436][ C7] kernfs_remove_by_name_ns+0x74/0xe8 [110121.667442][ C7] sysfs_remove_group+0x84/0xe8 [110121.667450][ C7] sysfs_remove_groups+0x34/0x58 [110121.667458][ C7] device_remove_groups+0x10/0x20 [110121.667464][ C7] device_release_driver_internal+0x164/0x2e4 [110121.667475][ C7] device_release_driver+0x18/0x28 [110121.667484][ C7] bus_remove_device+0xec/0x118 [110121.667491][ C7] device_del+0x1e8/0x4ac [110121.667498][ C7] device_unregister+0x18/0x38 [110121.667504][ C7] typec_unregister_altmode+0x30/0x44 [110121.667515][ C7] tcpm_reset_port+0xac/0x370 [110121.667523][ C7] tcpm_snk_detach+0x84/0xb8 [110121.667529][ C7] run_state_machine+0x4c0/0x1b68 [110121.667536][ C7] tcpm_state_machine_work+0x94/0xe4 [110121.667544][ C7] kthread_worker_fn+0x10c/0x244 [110121.667552][ C7] kthread+0x104/0x1d4 [110121.667557][ C7] ret_from_fork+0x10/0x20 [110121.667689][ C7] Workqueue: events dp_altmode_work [110121.667697][ C7] Call trace: [110121.667701][ C7] __switch_to+0x174/0x338 [110121.667710][ C7] __schedule+0x608/0x9f0 [110121.667717][ C7] schedule+0x7c/0xe8 [110121.667725][ C7] schedule_preempt_disabled+0x24/0x40 [110121.667733][ C7] __mutex_lock+0x408/0xdac [110121.667741][ C7] __mutex_lock_slowpath+0x14/0x24 [110121.667748][ C7] mutex_lock+0x40/0xec [110121.667757][ C7] tcpm_altmode_enter+0x78/0xb4 [110121.667764][ C7] typec_altmode_enter+0xdc/0x10c [110121.667769][ C7] dp_altmode_work+0x68/0x164 [110121.667775][ C7] process_one_work+0x1e4/0x43c [110121.667783][ C7] worker_thread+0x25c/0x430 [110121.667789][ C7] kthread+0x104/0x1d4 [110121.667794][ C7] ret_from_fork+0x10/0x20 Change tcpm_queue_vdm_unlocked to queue for tcpm_queue_vdm_work, which can perform the state check while holding the TCPM lock while the Alt Mode lock is no longer held. This requires a new struct to hold the vdm data, altmode_vdm_event. The Linux kernel CVE team has assigned CVE-2025-38268 to this issue. Affected and fixed versions =========================== Issue introduced in 6.9 with commit cdc9946ea6377e8e214b135ccc308c5e514ba25f and fixed in 6.12.34 with commit 7bdd712abefbec79176ab412d8c623e755c5d0ba Issue introduced in 6.9 with commit cdc9946ea6377e8e214b135ccc308c5e514ba25f and fixed in 6.15.3 with commit 1970d34b48cbeceb0c765984c9a6bb204c77f16a Issue introduced in 6.9 with commit cdc9946ea6377e8e214b135ccc308c5e514ba25f and fixed in 6.16-rc1 with commit 324d45e53f1a36c88bc649dc39e0c8300a41be0a 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-38268 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/usb/typec/tcpm/tcpm.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/7bdd712abefbec79176ab412d8c623e755c5d0ba https://git.kernel.org/stable/c/1970d34b48cbeceb0c765984c9a6bb204c77f16a https://git.kernel.org/stable/c/324d45e53f1a36c88bc649dc39e0c8300a41be0a