usb: gadget: net2280: Fix double free in probe error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f770fbec4165b1acfabdeadb01ad6008d2c537b5 · < e6f8be12f0307145b9a6010f044925952b37de8b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: net2280: Fix double free in probe error path
usb_initialize_gadget() installs gadget_release() as the release callback for the embedded gadget device. The struct net2280 instance is therefore released through gadget_release() when the gadget device's last reference is dropped.
The probe error path calls net2280_remove(), which tears down the partially initialized device and drops the gadget reference with usb_put_gadget(). Calling kfree(dev) afterwards can free the same object again.
Drop the explicit kfree() and let the gadget device release callback handle the final free. This issue was found by a static analysis tool I am developing.
From the CVE record · Linux
The Linux kernel’s net2280 USB gadget driver can free the same object twice during probe error handling. The input does not describe how an attacker could trigger this path or specify any access or user-interaction requirements.
Engineers running Linux kernels with the net2280 USB gadget driver should check their kernel version; affected versions are not specified.