clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe
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:
clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe
In function probe(), it returns directly without unregistered hws when error occurs.
Fix this by adding 'goto unregister_hws;' on line 295 and line 310.
Use devm_kzalloc() instead of kzalloc() to automatically free the memory using devm_kfree() when error occurs.
Replace of_iomap() with devm_of_iomap() to automatically handle the unused ioremap region and delete 'iounmap(anatop_base);' in unregister_hws.
From the CVE record · Linux
The Linux kernel’s i.MX93 clock probe can leak memory and leave registered clock hardware behind when an error occurs. The input does not establish whether an attacker can trigger the error or specify any access or user-interaction requirements.
Engineers running Linux kernels with the i.MX93 clock driver should check their affected versions; none are specified in the input.