From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E609858E2C0 for ; Fri, 11 Sep 2026 20:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157101; cv=none; b=Lv3M0gheFabt0Nz/GpBhl6pEg3cNOL3C8H6PqBI2UoKPqa/iHMPPvbXeEKXwr1HFCjTkm/voZ7x6wInFfmPJCjaNPuBMn8PbTupGUbwi/0WyyXE+SKDgQHtfMku8lJT3beHaIkH2MXV5kC4LDe/701pKGbvzTnH7QD1TJbaoZFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157101; c=relaxed/simple; bh=tz8G4RKsfZTvxFsXIAlcwPSRJ64pzZTj4/Fnkbd7Pyc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BqiH8m3Mn8jzr0isEiX8YltptcTQCVj1dKPqmUyaYIEO5w0KF8TqmwFku6b6dUHiWXg+OhxundlCGcBcPZw73ZKCd8tNraAK5SCPHY5yeyFhpvuvpnIO2NSR7uZttmacjcZfmM6SoD9Kvvtj4cpC/zeraIaAP69UY/gFLcJW6I4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uz5SlUjn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uz5SlUjn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 158031F000FF; Fri, 11 Sep 2026 20:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789157090; bh=CySkN3pSPae5vhfaKkIfYkjfzJOZTYWbSBw84tbjBJk=; h=From:To:Cc:Subject:Date:Reply-To; b=uz5SlUjnbpf6PyWuzYwSt3vIvLhj1WwiuJUfAaQtrHONtTySBN8Ibrcb/oACP5oAb zuLAbj2CRvKtB0I9Gk/+jM5/QsCl6lveoaVjEs1KajanR00jGn2j8WY7icFN8e1l4C m22Ia4b0bHmYyj216G/AnKrZfF6lsgzaaVm5lZl8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-89732: usb: gadget: f_fs: Prevent deadlock during ep0 read loop Date: Fri, 11 Sep 2026 21:47:01 +0200 Message-ID: <2026091102-CVE-2026-89732-e581@gregkh> X-Mailer: git-send-email 2.55.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3794; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UmOI9ibnnDb5cv48KeARdr67CRWNLVcdTli6ODZP4b4=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlLIrssS30dlvLlVcy+67D44L220L9ftsybYp09R6Kfz WXOjbjmjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIDyfDXLHjf/6vmZlQ8czh 1ZnjMsv3aF9LKGeYp393BsejDsWvmpIMRjsC3nz7Xb7WGQA= 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: f_fs: Prevent deadlock during ep0 read loop Currently, ffs_ep0_read() holds ffs->mutex when it prepares to go to sleep waiting for an event. When no setup events are pending, it calls wait_event_interruptible_exclusive_locked_irq() with the mutex still held. The wait macro deliberately drops the waitqueue spinlock before sleeping but does not drop the mutex. If a userspace daemon is polling ep0 via read() and the gadget is asynchronously torn down via configfs (e.g., echo "" > UDC), a deadlock can occur: 1. The configfs teardown calls functionfs_unbind(), which queues a FUNCTIONFS_UNBIND event. 2. The daemon wakes up, consumes the event, and drops the mutex. 3. However, if the daemon loops and immediately issues another read() before exiting, it reacquires ffs->mutex and again goes into an interruptible sleep. 4. Meanwhile, functionfs_unbind() continues execution and attempts to acquire ffs->mutex to tear down ep0req. 5. The kernel deadlocks because the configfs thread is stuck in an uninterruptible sleep waiting for the mutex, while the userspace daemon is in an interruptible sleep holding the mutex forever because no more events will arrive. To fix this, we drop both the waitqueue spinlock and ffs->mutex before going to sleep, and use wait_event_interruptible_exclusive() instead. Upon waking up, we jump back to the `retry` label to safely reacquire the mutex and re-evaluate the state machine. By not sleeping with ffs->mutex held, we natively decouple gadget teardowns (which require the mutex) from userspace polling. The Linux kernel CVE team has assigned CVE-2026-89732 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.35 with commit ddf8abd2599491cbad959c700b90ba72a5dce8d0 and fixed in 6.12.109 with commit fd20cc68bbdb5620696ac108e8f2efd180fe2c1a Issue introduced in 2.6.35 with commit ddf8abd2599491cbad959c700b90ba72a5dce8d0 and fixed in 6.18.50 with commit 34e88f53614640b59039a46717fb6142e9871022 Issue introduced in 2.6.35 with commit ddf8abd2599491cbad959c700b90ba72a5dce8d0 and fixed in 7.2.4 with commit eac233e63f9db82ba874e3cccafaafab162999e0 Issue introduced in 2.6.35 with commit ddf8abd2599491cbad959c700b90ba72a5dce8d0 and fixed in 7.3-rc1 with commit 569dd7e5dcffe1e1c6b26ca2cd3be57eb433e082 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-2026-89732 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/f_fs.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/fd20cc68bbdb5620696ac108e8f2efd180fe2c1a https://git.kernel.org/stable/c/34e88f53614640b59039a46717fb6142e9871022 https://git.kernel.org/stable/c/eac233e63f9db82ba874e3cccafaafab162999e0 https://git.kernel.org/stable/c/569dd7e5dcffe1e1c6b26ca2cd3be57eb433e082