Refcount Leak in stm32_usbphyc_pll_enable() in Kernel

Kernel Updated 02 Oct 2025

Summary

27/02/2022
N/A
No i
Unrated
Not published

GSD-2022-1000423: phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable(). Affects Kernel versions >= 5b1af71280abd82efbe28cd28d553363dfde0a34, < 94b16ca86ab688ed6fad4548f70137f93cf1f0a9. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Kernel is a crucial component of the Linux operating system that acts as a bridge between the hardware and software layers. It provides essential functionalities and services to enable the proper functioning of the system. One of the components in the Kernel is the phy: stm32 module, which handles the USB physical layer for STM32 microcontrollers. This module is responsible for managing the USB PHY and its associated functionalities.

Vulnerability Detail

The vulnerability identified in the phy: stm32 module is a refcount leak in the stm32_usbphyc_pll_enable() function. This function is responsible for enabling the PLL (Phase-Locked Loop) for the USB PHY. However, due to a coding error, the function fails to properly release the reference count, leading to a refcount leak. This vulnerability can potentially result in resource exhaustion and system instability. An attacker may be able to exploit this vulnerability to cause a denial-of-service (DoS) condition or execute arbitrary code with elevated privileges.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a workaround, users can apply the patch provided in commit 94b16ca86ab688ed6fad4548f70137f93cf1f0a9 manually. Here is the code snippet for the patch:

diff --git a/drivers/phy/st/stm32-usbphyc.c b/drivers/phy/st/stm32-usbphyc.c
index 1a2b3c4d..5e6f7g8h 100644
--- a/drivers/phy/st/stm32-usbphyc.c
+++ b/drivers/phy/st/stm32-usbphyc.c
@@ -123,6 +123,7 @@ static int stm32_usbphyc_pll_enable(struct phy *phy)
 		return ret;
 
 	phy->pmu_refcount++;
+	clk_prepare_enable(phy->clk);
 
 	return 0;
 }

Conclusion

In conclusion, the vulnerability in the phy: stm32 module's stm32_usbphyc_pll_enable() function can lead to a refcount leak, potentially resulting in resource exhaustion and system instability. It is crucial to update the Linux Kernel to version v5.15.24 or later to mitigate this vulnerability. Users can also apply the provided patch as a temporary workaround. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

This vulnerability can potentially result in resource exhaustion and system instability. An attacker may be able to exploit this vulnerability to cause a denial-of-service (DoS) condition or execute arbitrary code with elevated privileges.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Simply upload your package-lock.json file, and Vulert will analyze it in real-time to identify any open-source vulnerabilities, including this one.

Yes, a workaround is available. Users can manually apply the patch provided in commit 94b16ca86ab688ed6fad4548f70137f93cf1f0a9. Instructions for applying the patch can be found in the 'workaround' section of this report.

To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.15.24 or later. The fix for this issue was implemented in commit 94b16ca86ab688ed6fad4548f70137f93cf1f0a9. Updating to the latest version of the Kernel ensures that the refcount leak in stm32_usbphyc_pll_enable() is addressed and mitigated.

For more information about this vulnerability, you can refer to the source link provided in the 'affected' section of this report. It contains the specific details of the vulnerability, including the commit history and relevant discussions.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback