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 3330A58FD37 for ; Fri, 11 Sep 2026 20:06:30 +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=1789157193; cv=none; b=rffGdbLTe8DqwU+cOhjVT6YGwtKwGTzdcExZuFwxjKKV4lU7/yNFd4RnBp3DGy6FeTX8900eAgD1DL8ozY24gbjLymSZaVQP/R2N+Eqy6BXb6CDBKwpnwU6ecNss/e6+0QVJY9V8TI1tpj2OhBE+TX/Sj0QxCBCajP4BQofvOSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789157193; c=relaxed/simple; bh=2au8fEx3WB7q+T+mZNVz/6dXokSOUd4EgayNEcBSGIU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QZt556VWzjUy2riLkd2BW8WQtpYjUKK47WQRb6JIoNaXuDLNeeDWJ3lr3sdvw/xOcvdyU9mD6iJeakjOE6rAZyvKi2iq2vn1NpEC9sExJ+JdXOTl2HTnzGQ+Q/Gc3zas283e6lH8q1OOXwff3B7BJ9nY9I9pu6Wkmqs0ilvoQxs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2Le+oufG; 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="2Le+oufG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AE261F00893; Fri, 11 Sep 2026 20:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789157190; bh=SbbB+W//g+Ehunmr938RB9Z0k32+mfxOn/WTUowAjxE=; h=From:To:Cc:Subject:Date:Reply-To; b=2Le+oufGPgw5qntXeFFUCxDHHUAZtDMJ0YmT+ywOwf9H/Ij3KnmVFgxxMWCkv8Hr0 92eJZv/Ngf8+oToZwM322/dI8TphF8cvrxQaw7/nzdK78Pn4gBeL/uarrFczoJ0c1y SyX8s8VzFZlyTs2n0BMcAj2fVP3OToFOk5JUvEa8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-89739: usb: dwc3: gadget: Fix use-after-free in dwc3_gadget_free_endpoints due to race condition Date: Fri, 11 Sep 2026 21:47:08 +0200 Message-ID: <2026091104-CVE-2026-89739-00b4@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=3470; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3uzyPbKEbezShxlG6T/Frk8K4xQkggjSuzvgRfEqirs=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlLInvibXoCU4raV789Nk95a//PB4aLrtx1PNCa2XPp7 z3W7L5pHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR1KkMC1YGKsUGT7A0YY2K 9n561myFynPONQzzzNSjsn7KhDK3OSjbeqo+sst8uGcRAA== 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: dwc3: gadget: Fix use-after-free in dwc3_gadget_free_endpoints due to race condition In dwc3_gadget_init_endpoint, &dep->nostream_work is bound with dwc3_nostream_work, and dwc3_gadget_endpoint_stream_event can queue this delayed work on system_percpu_wq when a DEPEVT_STREAM_NOSTREAM event is received. If we remove the gadget, dwc3_gadget_free_endpoints makes cleanup and the memory allocated for dep with kzalloc() is released by kfree(dep), while the delayed work mentioned above may still be pending or running. The sequence of operations that may lead to a UAF bug is as follows: CPU0 CPU1 | dwc3_thread_interrupt | dwc3_endpoint_interrupt | dwc3_gadget_endpoint_stream_event | queue_delayed_work(system_percpu_wq, | &dep->nostream_work) dwc3_gadget_free_endpoints | dwc3_free_trb_pool(dep) | list_del(&dep->endpoint.ep_list) | dwc3_debugfs_remove_endpoint_dir(dep) | kfree(dep) | // dep is freed | | dwc3_nostream_work | // use dep (use-after-free) Fix it by canceling the delayed work before kfree(dep) in dwc3_gadget_free_endpoints. The Linux kernel CVE team has assigned CVE-2026-89739 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit dcfe437492e27d54f3ac491aed024da760f5c43c and fixed in 6.18.50 with commit 448e95c0f3eaa8d99f16ccae92ab94545f14413b Issue introduced in 6.14 with commit dcfe437492e27d54f3ac491aed024da760f5c43c and fixed in 7.2.4 with commit 93e08b13a7a30e4e78556d993720e0bc36231ec7 Issue introduced in 6.14 with commit dcfe437492e27d54f3ac491aed024da760f5c43c and fixed in 7.3-rc1 with commit 9c855832790cd488d87de1885974f4c37cfe7358 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-89739 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/dwc3/gadget.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/448e95c0f3eaa8d99f16ccae92ab94545f14413b https://git.kernel.org/stable/c/93e08b13a7a30e4e78556d993720e0bc36231ec7 https://git.kernel.org/stable/c/9c855832790cd488d87de1885974f4c37cfe7358