usb: gadget: uvc: fix dangling pointers in uvc_function_bind() and uvc_function_unbind()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0f9df939385527049c8062a099fbfa1479fe7ce0 · < 9897b7da8c0ad8356c1b8649379fcb5a689462cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: uvc: fix dangling pointers in uvc_function_bind() and uvc_function_unbind()
In uvc_function_bind() error path, we use usb_ep_free_request which uses uvc->control_req but does not set it to NULL afterwards. Thus, uvc->control_req is a dangling pointer causing a UAF. Also we do not set the uvc->control_buf pointer to NULL after freeing it, which is another dangling pointer. Fix it by setting uvc->control_req to NULL after we run usb_ep_free_request() and uvc->control_buf to NULL after kfree. Do the same for uvc_function_unbind().
From the CVE record · Linux
The Linux kernel USB gadget UVC code can leave dangling pointers when binding fails or during unbinding. The dangling request pointer can cause a use-after-free; the input does not specify how an attacker could trigger it or whether access or user interaction is required.
Engineers running Linux kernels with the USB gadget UVC component should check whether their kernel is affected; affected versions are not specified.