CVE-2023-54097
Description
In the Linux kernel, the following vulnerability has been resolved:
regulator: stm32-pwr: fix of_iomap leak
Smatch reports: drivers/regulator/stm32-pwr.c:166 stm32_pwr_regulator_probe() warn: 'base' from of_iomap() not released on lines: 151,166.
In stm32_pwr_regulator_probe(), base is not released when devm_kzalloc() fails to allocate memory or devm_regulator_register() fails to register a new regulator device, which may cause a leak.
To fix this issue, replace of_iomap() with devm_platform_ioremap_resource(). devm_platform_ioremap_resource() is a specialized function for platform devices. It allows 'base' to be automatically released whether the probe function succeeds or fails.
Besides, use IS_ERR(base) instead of !base as the return value of devm_platform_ioremap_resource() can either be a pointer to the remapped memory or an ERR_PTR() encoded error code if the operation fails.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel driver stm32-pwr, a missing release of an of_iomap() mapping could cause a memory leak on probe failure.
CVE-2023-54097: Memory leak in stm32-pwr regulator driver
In the stm32_pwr_regulator_probe() function of the Linux kernel's STM32 power regulator driver, a memory leak occurs when of_iomap() is used to map device memory but the resulting base pointer is not released if certain subsequent allocations or registrations fail. Specifically, if devm_kzalloc() fails to allocate memory or devm_regulator_register() fails, the mapped I/O memory is never unmapped, causing a leak [1].
Exploitation and attack surface This issue is a resource leak that triggers during driver probe. An attacker would need to cause the probe to fail—for example, by exhausting kernel memory or by interfering with regulator registration—while the driver is being loaded. Since this is a platform driver, it is typically loaded during boot or when a device is discovered; local access or the ability to trigger a probe failure is required. No authentication is explicitly needed, but the attack surface is limited to local or privileged contexts that can influence driver probing.
Impact If an attacker can repeatedly force probe failures (e.g., by exhausting memory), the leak of the base mapping would gradually consume system memory, potentially leading to denial of service. The leak is limited to the I/O memory region mapped by of_iomap(), which is typically small, but repeated failures could accumulate.
Mitigation The fix replaces of_iomap() with devm_platform_ioremap_resource(), which uses the device-managed resource framework to automatically release the mapping when the probe function exits—whether successfully or on error. The patch also updates the error check to use IS_IS_ERR() instead of !base`. This fix has been applied to stable kernel trees (e.g., commits 0ad07e02be0d3f0d554653382ffe53ae4879378d and others) [1][2][3][4]. Users should update their kernel to a version containing one of these commits.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
7824683dbec23dfce9bb3517aad6481f49fb2f25994f7a9adc091bb49b3230ad07e02be0dc4a413e56d16Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- git.kernel.org/stable/c/0ad07e02be0d3f0d554653382ffe53ae4879378dnvd
- git.kernel.org/stable/c/824683dbec234a01bd49a0589ee3323594a6f4cfnvd
- git.kernel.org/stable/c/ad6481f49fb2c703efa3a929643934f24b666d6anvd
- git.kernel.org/stable/c/c091bb49b3233307c7af73dae888f0799752af3dnvd
- git.kernel.org/stable/c/c4a413e56d16a2ae84e6d8992f215c4dcc7fac20nvd
- git.kernel.org/stable/c/dfce9bb3517a78507cf96f9b83948d0b81338afanvd
- git.kernel.org/stable/c/f25994f7a9ad53eb756bc4869497c3ebe281ad5envd
News mentions
0No linked articles in our index yet.