media: uvcvideo: Fix crash during unbind if gpio unit is in use
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2886477ff98740cc3333cf785e4de0b1ff3d7a28 · < a9ea1a3d88b7947ce8cadb2afceee7a54872bbc5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: uvcvideo: Fix crash during unbind if gpio unit is in use
We used the wrong device for the device managed functions. We used the usb device, when we should be using the interface device.
If we unbind the driver from the usb interface, the cleanup functions are never called. In our case, the IRQ is never disabled.
If an IRQ is triggered, it will try to access memory sections that are already free, causing an OOPS.
We cannot use the function devm_request_threaded_irq here. The devm_* clean functions may be called after the main structure is released by uvc_delete.
Luckily this bug has small impact, as it is only affected by devices with gpio units and the user has to unbind the device, a disconnect will not trigger this error.
From the CVE record · Linux
The Linux kernel's uvcvideo driver can leave an IRQ enabled when a USB interface is unbound because it uses the wrong device for managed cleanup. On devices with GPIO units, a user must unbind the driver; if an IRQ then fires, it can access freed memory and cause a kernel OOPS. Disconnecting the device does not trigger the issue.
Engineers running Linux kernels with the uvcvideo driver and devices that have GPIO units should check their kernel's status; affected versions were not provided.