CVE-2023-54228: regulator: raa215300: Fix resource leak in case of error
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
regulator: raa215300: Fix resource leak in case of error
The clk_register_clkdev() allocates memory by calling vclkdev_alloc() and this memory is not freed in the error path. Similarly, resources allocated by clk_register_fixed_rate() are not freed in the error path.
Fix these issues by using devm_clk_hw_register_fixed_rate() and devm_clk_hw_register_clkdev().
After this, the static variable clk is not needed. Replace it with local variable hw in probe() and drop calling clk_unregister_fixed_rate() from raa215300_rtc_unregister_device().
The Linux kernel CVE team has assigned CVE-2023-54228 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.5 with commit 7bce16630837c705f72e8fd53a11ae8c236236f4 and fixed in 6.5.4 with commit 2bf2d2ac9e67184dc99275875a6452ca6e3027ff Issue introduced in 6.5 with commit 7bce16630837c705f72e8fd53a11ae8c236236f4 and fixed in 6.6 with commit e21ac64e669e960688e79bf5babeed63132dac8a
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2023-54228
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/regulator/raa215300.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/2bf2d2ac9e67184dc99275875a6452ca6e3027ff https://git.kernel.org/stable/c/e21ac64e669e960688e79bf5babeed63132dac8a