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 582801DE3AB for ; Fri, 7 Mar 2025 09:10:23 +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=1741338624; cv=none; b=RFhosK1jcjOl6XjB+mlV7ekR8MckZGOq4j0GsYMfKvDyCaB8KZ+rqSiSKi289V34qHnZwP+Kjx7JKrNjzhC/G1YSeuD1Rcxo2Gg2JqD21j9RC8DQXymAdQKEz4H3m0WhL558PEN3hNNVnVFVeUaCNaC91qNV/z/UvvmkBWxE8Dw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741338624; c=relaxed/simple; bh=KsKjL2AiuarGcLnUkWfWTSLToBzfuM1X0pMCChrf4v0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Cm5eamqrM2fWIh1oKr88T1p6Cc+vD940bZV8qJHBIzAhn0DyOp0K3/RkjOEnKqjNBAca0QNDFmCS4jnO8922RvjSpjSdmFaDYNJ4cS+tF/VXHgdlT1GPrd/kmGP1yPWrnnl3oHzveINHUGojaqFDlK9jDOiJvvnseMLQ3zOgX18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fZd68rD3; 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="fZd68rD3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FAD8C4CED1; Fri, 7 Mar 2025 09:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741338623; bh=KsKjL2AiuarGcLnUkWfWTSLToBzfuM1X0pMCChrf4v0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=fZd68rD3jziGdGW4dGtsyihxbCkGN41djH55yM/K4YfXkOvimNeWBU0XPCvQUDGXf JEmeYxFcFBUpvBPhw0NoOgOBoCB0yS7+y4IDduzpap0j/gWfk5QmJqfjjZ6DE0fJc5 Cx3F6fUP8rB8DLzqQ24slpGOxW2NuiirTnYiVspc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21838: usb: gadget: core: flush gadget workqueue after device removal Date: Fri, 7 Mar 2025 10:10:08 +0100 Message-ID: <2025030706-CVE-2025-21838-5ade@gregkh> X-Mailer: git-send-email 2.48.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=2689; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=KsKjL2AiuarGcLnUkWfWTSLToBzfuM1X0pMCChrf4v0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOmntr/buC3jU2r6/7/619gz06LcLnf56D1jVN3zeWbkn c+73qT96IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJ/FrCsGD3z/bQuV+kCnU9 Xmd8522JzViXrMCw4PTh1S+27ZlqfdbWRaj3/EWn/KPldgA= 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: usb: gadget: core: flush gadget workqueue after device removal device_del() can lead to new work being scheduled in gadget->work workqueue. This is observed, for example, with the dwc3 driver with the following call stack: device_del() gadget_unbind_driver() usb_gadget_disconnect_locked() dwc3_gadget_pullup() dwc3_gadget_soft_disconnect() usb_gadget_set_state() schedule_work(&gadget->work) Move flush_work() after device_del() to ensure the workqueue is cleaned up. The Linux kernel CVE team has assigned CVE-2025-21838 to this issue. Affected and fixed versions =========================== Issue introduced in 3.12 with commit 5702f75375aa9ecf8ad3431aef3fe6ce8c8dbd15 and fixed in 6.6.80 with commit 859cb45aefa6de823b2fa7f229fe6d9562c9f3b7 Issue introduced in 3.12 with commit 5702f75375aa9ecf8ad3431aef3fe6ce8c8dbd15 and fixed in 6.12.16 with commit f894448f3904d7ad66fecef8f01fe0172629e091 Issue introduced in 3.12 with commit 5702f75375aa9ecf8ad3431aef3fe6ce8c8dbd15 and fixed in 6.13.4 with commit 97695b5a1b5467a4f91194db12160f56da445dfe Issue introduced in 3.12 with commit 5702f75375aa9ecf8ad3431aef3fe6ce8c8dbd15 and fixed in 6.14-rc3 with commit 399a45e5237ca14037120b1b895bd38a3b4492ea 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-21838 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/udc/core.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/859cb45aefa6de823b2fa7f229fe6d9562c9f3b7 https://git.kernel.org/stable/c/f894448f3904d7ad66fecef8f01fe0172629e091 https://git.kernel.org/stable/c/97695b5a1b5467a4f91194db12160f56da445dfe https://git.kernel.org/stable/c/399a45e5237ca14037120b1b895bd38a3b4492ea