spi: rockchip-sfc: Fix double-free in remove() callback
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 |
|
|
6.18.196.19.97.0In the Linux kernel, the following vulnerability has been resolved:
spi: rockchip-sfc: Fix double-free in remove() callback
The driver uses devm_spi_register_controller() for registration, which automatically unregisters the controller via devm cleanup when the device is removed. The manual call to spi_unregister_controller() in the remove() callback can lead to a double-free.
And to make sure controller is unregistered before DMA buffer is unmapped, switch to use spi_register_controller() in probe().
From the CVE record · Linux
The Linux kernel’s rockchip-sfc driver can double-free a SPI controller when a device is removed because its remove callback unregisters a controller that managed cleanup also unregisters. The input does not establish whether an attacker can trigger device removal, whether authentication or user interaction is needed, or what impact beyond the double-free is possible.
Engineers running Linux kernels with the rockchip-sfc driver should check their versions against the vendor advisory; affected versions were not provided.