Skip to contentSkip to conversation

CVE-2026-98765: USB: gadget: dummy-hcd: Fix wait for outstanding request completions

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 18

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

USB: gadget: dummy-hcd: Fix wait for outstanding request completions

The dummy-hcd driver emulates synchronize_irq() by waiting until its private callback_usage counter drops to 0 (with the private lock not held). This counter is incremented whenever a gadget driver callback occurs (which requires the private lock to be dropped), but not when a request completion handler is called.

This is an oversight. Request completion is triggered by timer interrupts (emulating device IRQs in a real UDC), and the interrupt handlers are supposed to have completed when the synchronize_irq() emulation routine returns -- they aren't supposed to be in the middle of a completion callback. If this happens it can lead to a gadget driver's unbind routine running before all outstanding request completions have finished, maybe even allowing the gadget driver's module to be unloaded while a completion handler is still running.

Fix the oversight by incrementing the callback_usage value across request completion callbacks.

The Linux kernel CVE team has assigned CVE-2026-98765 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.14 with commit 7dbd8f4cabd96db5a50513de9d83a8105a5ffc81 and fixed in 6.12.113 with commit 7ce4dca0d53b1c3cb2b7e7bb2e42bf5db860caf2
	Issue introduced in 4.14 with commit 7dbd8f4cabd96db5a50513de9d83a8105a5ffc81 and fixed in 6.18.56 with commit 5298c96bf0068f3160969f7ddad81976d01a9b66
	Issue introduced in 4.14 with commit 7dbd8f4cabd96db5a50513de9d83a8105a5ffc81 and fixed in 7.2.10 with commit 3070806a7bc7bb36ed04a21022c09dafcc5619f4
	Issue introduced in 4.14 with commit 7dbd8f4cabd96db5a50513de9d83a8105a5ffc81 and fixed in 7.3-rc6 with commit b263ff9b0fc5c1f371d65c4eb196b31263d039ff
	Issue introduced in 3.2.97 with commit 7b416b9dac6ede26d4ca0c1a88b448b543623ff3
	Issue introduced in 3.16.52 with commit 8590bc1da625dd4a589eac0fc3aa3cf4f400424d
	Issue introduced in 4.1.46 with commit a867d5b932ac4911d3f8a1e63505061b0c81f889
	Issue introduced in 4.4.92 with commit e84b4a008365b7edbd842a063ae28d040a98db25
	Issue introduced in 4.9.55 with commit e39b17143a5b5aac81f066d455e5d3a9877eb3ae
	Issue introduced in 4.13.6 with commit 4f8ae1fcb0dfbb72a7678f81bf01fb7fc85c6715

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-98765

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/dummy_hcd.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/7ce4dca0d53b1c3cb2b7e7bb2e42bf5db860caf2
	https://git.kernel.org/stable/c/5298c96bf0068f3160969f7ddad81976d01a9b66
	https://git.kernel.org/stable/c/3070806a7bc7bb36ed04a21022c09dafcc5619f4
	https://git.kernel.org/stable/c/b263ff9b0fc5c1f371d65c4eb196b31263d039ff