Memory Leak in ab8500_fg_sysfs_init in Kernel
Summary
GSD-2022-1001231: power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init. Affects Kernel versions >= 8c0984e5a75337df513047ec92a6c09d78e3e5cd, < c32f6b6196b6efc1c68990dfeaac36fb8eb3b8e1. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The Kernel is a crucial component of the Linux operating system that manages communication between hardware and software. It provides essential services and functions for the system's operation. The ab8500_fg_sysfs_init function is responsible for initializing the sysfs interface for the AB8500 fuel gauge driver in the Kernel's power supply subsystem. This driver is used to monitor the battery level and provide power-related information to the system. However, a memory leak vulnerability exists in the ab8500_fg_sysfs_init function, which can lead to the exhaustion of system memory resources over time.
Vulnerability Detail
The memory leak vulnerability in ab8500_fg_sysfs_init allows an attacker to continuously allocate memory without releasing it, leading to a gradual depletion of available memory resources. This can result in system instability, performance degradation, and potentially denial-of-service conditions. The vulnerability was introduced in version v4.9 of the Linux Kernel by commit 8c0984e5a75337df513047ec92a6c09d78e3e5cd and was fixed in version v5.17.2 by commit c32f6b6196b6efc1c68990dfeaac36fb8eb3b8e1.
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
If updating the Kernel is not immediately feasible, a temporary workaround can be implemented to mitigate the memory leak. This workaround involves manually releasing the allocated memory by modifying the ab8500_fg_sysfs_init function. Here is an example of the modified code:
void ab8500_fg_sysfs_init()
{
// Existing code
// Add the following line to release the allocated memory
kfree(sysfs_attr);
}
Please note that this workaround is not a permanent solution and should only be used until the Kernel can be updated.
Conclusion
The memory leak vulnerability in the ab8500_fg_sysfs_init function of the Kernel's power supply subsystem can lead to system instability and performance degradation. It is crucial to update the Linux Kernel to version v5.17.2 or later to fix this vulnerability. In the meantime, a temporary workaround can be implemented to mitigate the issue. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The memory leak vulnerability can lead to system instability, performance degradation, and potential denial-of-service conditions due to the gradual depletion of available memory resources.
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 any open-source vulnerabilities, including this memory leak issue.
At the time of this report, there are no known public exploits targeting this specific memory leak vulnerability. However, it is always recommended to promptly apply security patches and updates to mitigate potential risks.
No, this vulnerability requires local access to the affected system to exploit. It cannot be exploited remotely over a network.
The primary solution is to update the Linux Kernel to the fixed version. However, if updating the Kernel is not immediately feasible, implementing the provided workaround can help mitigate the memory leak temporarily.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.