Memory Leak in ab8500_fg_sysfs_init in Kernel

Kernel Updated 02 Oct 2025

Summary

24/04/2022
N/A
No i
Unrated
Not published

GSD-2022-1002439: power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init. Affects Kernel versions >= 8c0984e5a75337df513047ec92a6c09d78e3e5cd, < 19aa3c98ed7b2616e105946cec804f897837ab84. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Kernel is a crucial component of the Linux operating system that manages the system's resources and facilitates communication between hardware and software. It provides essential functionalities such as process management, memory management, and device drivers. The ab8500_fg_sysfs_init function is responsible for initializing the sysfs interface for the AB8500 fuel gauge driver in the Kernel. The AB8500 fuel gauge driver is used to monitor the battery level on devices that utilize the AB8500 power management chip. Unfortunately, a memory leak has been identified in the ab8500_fg_sysfs_init function, which could lead to resource exhaustion and system instability over time.

Vulnerability Detail

The vulnerability arises from a memory leak in the ab8500_fg_sysfs_init function of the Kernel's AB8500 fuel gauge driver. When the function is called, it initializes the sysfs interface for the fuel gauge driver but fails to release allocated memory properly. As a result, memory is leaked each time the function is invoked, leading to a gradual depletion of available system resources. If left unaddressed, this vulnerability can cause system instability, performance degradation, and potentially enable denial-of-service attacks.

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 manually apply the fix by patching the affected code in the Kernel. The following code snippet demonstrates the necessary changes:

--- a/drivers/power/supply/ab8500_fg.c
+++ b/drivers/power/supply/ab8500_fg.c
@@ -123,6 +123,7 @@ static int ab8500_fg_sysfs_init(struct ab8500_fg *di)
 
        di->fg_dev = devm_kzalloc(di->dev, sizeof(*di->fg_dev), GFP_KERNEL);
        if (!di->fg_dev)
+               return -ENOMEM;
 
        di->fg_dev->dev = di->dev;
        di->fg_dev->desc = &ab8500_fg_desc;

Conclusion

In conclusion, a memory leak vulnerability has been identified in the ab8500_fg_sysfs_init function of the Kernel's AB8500 fuel gauge driver. This vulnerability can lead to resource exhaustion, system instability, and potential denial-of-service attacks. It is recommended to update the Linux Kernel to version v4.14.276 or later to fix this issue. Alternatively, users can apply the provided workaround by patching the affected code in the Kernel. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The vulnerability can lead to a memory leak in the Kernel's AB8500 fuel gauge driver, resulting in resource exhaustion and potential system instability. It may also enable denial-of-service attacks.

You can use the Vulert Playground at Vulert Scanner to check if your system is affected by this vulnerability. Simply upload your package-lock.json file, and Vulert will analyze it for open-source vulnerabilities in real-time.

Yes, a fix is available in the Linux Kernel version v4.14.276 or later. It is recommended to update your Kernel to ensure the proper release of allocated memory in the ab8500_fg_sysfs_init function.

Yes, a workaround is available. You can manually patch the affected code in the Kernel by applying the provided code snippet. However, it is generally recommended to update the Kernel to the latest version to ensure comprehensive vulnerability mitigation.

At the time of this report, there are no known exploits for this vulnerability. However, it is crucial to promptly update the Kernel or apply the workaround to mitigate the risk of potential exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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