usb: gadget: r8a66597: avoid double free of ep0_req in probe error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 776976a67ae25d18be42794fd783a50757402cbe · < 6648c470918371766f6d368113dd2a4faebac93f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: r8a66597: avoid double free of ep0_req in probe error path
If usb_add_gadget_udc() fails, r8a66597_probe() jumps to err_add_udc and frees ep0_req, then falls through to clean_up2 where ep0_req is freed again when it is non-NULL.
Remove the redundant free from err_add_udc and keep the cleanup in clean_up2 so the request is released exactly once.
Issue found using a prototype static analysis tool and confirmed by code review.
From the CVE record · Linux
The r8a66597 USB gadget driver can free ep0_req twice if usb_add_gadget_udc() fails during probe. The input does not establish whether an attacker can trigger this failure or specify any access or user-interaction requirements.
Engineers running Linux kernels with the r8a66597 USB gadget driver should check their versions; affected versions are not specified.