CVE-2026-99555: media: usbtv: fix null-pointer dereference on disconnect
In the Linux kernel, the following vulnerability has been resolved:
media: usbtv: fix null-pointer dereference on disconnect
A null-pointer dereference can occur in usbmakepath() when called from usbtvquerycap() (and other ioctl handlers) during device disconnection.
Oops: general protection fault, probably for non-canonical address 0xdffffc000000000a: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000050-0x0000000000000057] RIP: 0010:usbmakepath include/linux/usb.h:985 [inline] RIP: 0010:usbtvquerycap+0x9c/0x100 drivers/media/usb/usbtv/usbtv-video.c:612 ... Call Trace: <TASK> v4lquerycap+0x236/0x470 drivers/media/v4l2-core/v4l2-ioctl.c:1106 videodoioctl+0x8af/0xc70 drivers/media/v4l2-core/v4l2-ioctl.c:3133 videousercopy+0x860/0x1430 drivers/media/v4l2-core/v4l2-ioctl.c:3475 v4l2ioctl+0x18d/0x1e0 drivers/media/v4l2-core/v4l2-dev.c:366 vfsioctl fs/ioctl.c:51 [inline] dosysioctl fs/ioctl.c:597 [inline] sesysioctl+0xfc/0x170 fs/ioctl.c:583 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0x174/0x580 arch/x86/entry/syscall64.c:94
This happens due to a race condition between the USB device disconnect routine (usbtvdisconnect()) and V4L2 ioctls. When the device is disconnected, usbtvdisconnect() sets usbtv->udev = NULL without holding the usbtv->v4l2lock mutex. Concurrently, an ioctl handler like usbtvquerycap() can be executing under the v4l2lock and attempt to use usbtv->udev, leading to a crash.
To fix this, move the usbtv->udev = NULL assignment into usbtvvideofree() and protect it with mutexlock(&usbtv->v4l2lock). This ensures that no non-queue ioctl handler can run concurrently with the pointer being nullified. If an ioctl is already running, the mutex will block the disconnect path until the ioctl finishes. If an ioctl is blocked waiting for the lock, it will acquire it after the disconnect routine releases it, but will then check videoisregistered() (which was cleared by vb2videounregisterdevice()) and safely return -ENODEV.
Acquiring v4l2lock after vb2videounregisterdevice() avoids reintroducing a historical deadlock issue, and usbtvaudiofree() remains safe as it is called before usbtvvideofree().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.16 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.2 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.7 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.9 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.3-1 - Compensating control
In the usbtv disconnect path, move the usbtv->udev = NULL assignment into usbtv_video_free() and protect it with usbtv->v4l2_lock; acquire the lock after vb2_video_unregister_device() to avoid the historical deadlock.