CVE-2026-90147: clk: devres: fix cleanup in devm_clk_get_optional_enabled_with_rate()
In the Linux kernel, the following vulnerability has been resolved:
clk: devres: fix cleanup in devmclkgetoptionalenabledwithrate()
devmclkgetoptionalenabledwithrate() registers its cleanup action before setting the clock rate. If setting the rate fails, it attempts to disable and unprepare a clock that was never enabled. This issue was spotted while reviewing "rust: clk: add devres-managed clks" [1].
Register the cleanup action only after successfully preparing and enabling the clock.
[1]: https://lore.kernel.org/rust-for-linux/20260706-clk-type-state-v5-3-67c5f326a16c@collabora.com
Event History
Frequently Asked Questions
When can this issue be triggered?
It can occur when devm_clk_get_optional_enabled_with_rate() reaches a clock-rate-setting failure after registering its cleanup action but before the clock has been successfully prepared and enabled.
What is the remediation?
Apply the available stable fixes referenced for this issue. The correction registers the cleanup action only after the clock has been successfully prepared and enabled.