Skip to contentSkip to conversation

CVE-2026-99469: media: gspca: use vb2_video_unregister_device() on disconnect

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 19

lore
Share & tools
lore
#0 lore raw

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

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

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

media: gspca: use vb2_video_unregister_device() on disconnect

gspca uses vb2_fop_release(), but gspca_disconnect() only unregisters the video device. If the queue owner closes the device after USB disconnect, vb2_fop_release() releases the queue and invokes gspca_stop_streaming() at that point.

gspca_stream_off() calls subdriver stop callbacks and usb_set_interface() through gspca_dev->dev. By the time the late close runs, the USB core can have freed the usb_device, resulting in a use-after-free. This was observed as a KASAN use-after-free in sd_stopN().

Use vb2_video_unregister_device() so the queue is released and streaming is stopped synchronously during disconnect, while the usb_device is still valid. Since the helper takes the queue lock, which is usb_lock, call it after dropping that lock.

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

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

	Issue introduced in 5.10 with commit f729ef5796d82a95758d9edc7eea5879a3a12b25 and fixed in 6.12.117 with commit fda9ca3cbee24f6e48c04946a8d2f66565d2d4b2
	Issue introduced in 5.10 with commit f729ef5796d82a95758d9edc7eea5879a3a12b25 and fixed in 6.18.61 with commit d02a2ed057372d3739ab23d778fc4e04d3330513
	Issue introduced in 5.10 with commit f729ef5796d82a95758d9edc7eea5879a3a12b25 and fixed in 7.3.2 with commit f6b21af3e32f142bf3e591dbb10044c60472f716
	Issue introduced in 5.10 with commit f729ef5796d82a95758d9edc7eea5879a3a12b25 and fixed in 7.4-rc1 with commit 3dbbbc3cafa2de377d9b97af4e35b8b6b5282047

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

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/media/usb/gspca/gspca.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/fda9ca3cbee24f6e48c04946a8d2f66565d2d4b2
	https://git.kernel.org/stable/c/d02a2ed057372d3739ab23d778fc4e04d3330513
	https://git.kernel.org/stable/c/f6b21af3e32f142bf3e591dbb10044c60472f716
	https://git.kernel.org/stable/c/3dbbbc3cafa2de377d9b97af4e35b8b6b5282047