usb: typec: ucsi: glink: fix use-after-free of ucsi on remove
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: typec: ucsi: glink: fix use-after-free of ucsi on remove
The pmic_glink client is released by the devres cleanup, which runs after pmic_glink_ucsi_remove() has returned, so its notification callbacks can queue work until then. Work that runs after ucsi_unregister() has been called touches freed state: it dereferences the connector array that ucsi_unregister() freed, or registers and unregisters the instance a second time.
Disable both work items with disable_work_sync() before unregistering, and unregister only if the instance is still registered.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The Linux kernel’s USB Type-C UCSI GLINK driver can queue work during device removal that accesses state freed by unregistering UCSI. The input does not establish whether an attacker can trigger this issue, or specify access or user-interaction requirements.
Engineers running Linux kernels with the USB Type-C UCSI GLINK driver should check their versions; affected versions are not specified.