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 428272EE276 for ; Fri, 25 Jul 2025 15:28:46 +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=1753457326; cv=none; b=r4WrUycoxTbgeO1UsMWAQjBjNcleUMSL4PghU/4wZ+HxiubqeHn4tXpKMebHCxocwM+TTQbUwu4O3gwtMRgqjlHTZW+tssJWd5SAkWz78ESCVl5DbnkuI0pB8ZlmirX/99YhenM4bLpEXVGVxfUMyeAWmaPiBu94KHM8Hq9mEiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753457326; c=relaxed/simple; bh=IHdylHGt1OqNI/+T50sJk9cyqihTZvRfDNv6vxyDEDM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ScI99a6WzoRhTTl1BHefjYNaMNt+7GJqCnCJ4lHLG5VXykXHOMlq8RutCGzavQle+L/lozy2EH5cJ24sEHnX1HDetorKIMThMm8Yd19JVnx5hNd3DTJ9ALZHUDuLHJWZdTp2YD02cAjrKgFTOI9n3wYPVcyhOH6wtx2Mb4V9UdU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zAANgpOS; 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="zAANgpOS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A10BEC4CEE7; Fri, 25 Jul 2025 15:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753457326; bh=IHdylHGt1OqNI/+T50sJk9cyqihTZvRfDNv6vxyDEDM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=zAANgpOS6w6wI2HU/3ap5U9/D9ap7TY3dihIRq+QP1JD21mjTvwmXaXH4F0EJsSTN U9mBrJQ2jqKucaLkOtOiq3TU/+58fep63fgDbeqVlNAZU63DDzijp+EjoUWx9dP2gv ZO5JYaz1zlBVaBhaTWyqK0eutNAKWOwixlg0xFy0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38448: usb: gadget: u_serial: Fix race condition in TTY wakeup Date: Fri, 25 Jul 2025 17:28:10 +0200 Message-ID: <2025072504-CVE-2025-38448-f242@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=3724; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=97l5f1x5zXljeNNSIYzC0Q/wwhbi6j3qg6MYORaNC1I=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNi1pu8rEcq5325mH8jTSNrbvl775cWrQwc1J78K55b EuEnRq+d8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE3GYyzHfm9JGZXWmYMjmA b+d6K/ttJx4desaw4MzNVUu9fqxmmp6+75qR78qyipt/KwE= 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: gadget: u_serial: Fix race condition in TTY wakeup A race condition occurs when gs_start_io() calls either gs_start_rx() or gs_start_tx(), as those functions briefly drop the port_lock for usb_ep_queue(). This allows gs_close() and gserial_disconnect() to clear port.tty and port_usb, respectively. Use the null-safe TTY Port helper function to wake up TTY. Example CPU1: CPU2: gserial_connect() // lock gs_close() // await lock gs_start_rx() // unlock usb_ep_queue() gs_close() // lock, reset port.tty and unlock gs_start_rx() // lock tty_wakeup() // NPE The Linux kernel CVE team has assigned CVE-2025-38448 to this issue. Affected and fixed versions =========================== Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 5.4.296 with commit 18d58a467ccf011078352d91b4d6a0108c7318e8 Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 5.10.240 with commit d43657b59f36e88289a6066f15bc9a80df5014eb Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 5.15.189 with commit a5012673d49788f16bb4e375b002d7743eb642d9 Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 6.1.146 with commit ee8d688e2ba558f3bb8ac225113740be5f335417 Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 6.6.99 with commit c6eb4a05af3d0ba3bc4e8159287722fb9abc6359 Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 6.12.39 with commit abf3620cba68e0e51e5c21054ce4f925f75b3661 Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 6.15.7 with commit c8c80a3a35c2e3488409de2d5376ef7e662a2bf5 Issue introduced in 3.5 with commit 35f95fd7f234d2b58803bab6f6ebd6bb988050a2 and fixed in 6.16-rc5 with commit c529c3730bd09115684644e26bf01ecbd7e2c2c9 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-38448 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/gadget/function/u_serial.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/18d58a467ccf011078352d91b4d6a0108c7318e8 https://git.kernel.org/stable/c/d43657b59f36e88289a6066f15bc9a80df5014eb https://git.kernel.org/stable/c/a5012673d49788f16bb4e375b002d7743eb642d9 https://git.kernel.org/stable/c/ee8d688e2ba558f3bb8ac225113740be5f335417 https://git.kernel.org/stable/c/c6eb4a05af3d0ba3bc4e8159287722fb9abc6359 https://git.kernel.org/stable/c/abf3620cba68e0e51e5c21054ce4f925f75b3661 https://git.kernel.org/stable/c/c8c80a3a35c2e3488409de2d5376ef7e662a2bf5 https://git.kernel.org/stable/c/c529c3730bd09115684644e26bf01ecbd7e2c2c9