Memory Leak Vulnerability in iio: accel: kxcjk-1013
Summary
GSD-2021-1002385: iio: accel: kxcjk-1013: Fix possible memory leak in probe and remove. Affects Kernel versions >= a25691c1f9674090fb66586cf4c5d60d3efdf339, < 60a55b9d91ba99eb8cf015bc46dc2de05e168a15. 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 iio: accel: kxcjk-1013 package is a component of the Linux Kernel that provides support for the KXCJK-1013 accelerometer. This accelerometer is commonly used in various devices to measure acceleration. The package allows applications to interact with the accelerometer and retrieve acceleration data. However, a vulnerability has been discovered in the package that could lead to a memory leak.
Vulnerability Detail
The vulnerability in iio: accel: kxcjk-1013 is related to a possible memory leak in the probe and remove functions. When the package is initialized or removed, there is a chance that memory resources are not properly released, resulting in a memory leak. This could potentially lead to resource exhaustion and impact the overall performance and stability of the system. The vulnerability was introduced in version v4.2 of the Linux Kernel and has been fixed in version v4.9.293.
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 Linux Kernel is not immediately feasible, a temporary workaround can be implemented to mitigate the memory leak vulnerability. The workaround involves modifying the probe and remove functions in the iio: accel: kxcjk-1013 package to ensure proper release of memory resources. Here is an example of the modified code:
// Probe function
static int kxcjk_1013_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
// Existing code
// Add memory release
kfree(data);
return 0;
}
// Remove function
static int kxcjk_1013_remove(struct i2c_client *client)
{
// Existing code
// Add memory release
kfree(data);
return 0;
}
Conclusion
The memory leak vulnerability in iio: accel: kxcjk-1013 can be mitigated by updating the Linux Kernel to version v4.9.293 or later. Alternatively, a temporary workaround can be implemented by modifying the probe and remove functions. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
iio: accel: kxcjk-1013 is a package in the Linux Kernel that provides support for the KXCJK-1013 accelerometer. It allows applications to interact with the accelerometer and retrieve acceleration data.
A memory leak is a software bug where allocated memory is not properly released, leading to a gradual loss of available memory. In the case of iio: accel: kxcjk-1013, the memory leak can result in resource exhaustion and impact system performance.
You can use Vulert's playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just a manifest file like package-lock.json.
The memory leak vulnerability in iio: accel: kxcjk-1013 can lead to resource exhaustion and impact the overall performance and stability of the system. It is important to apply the necessary fixes or workarounds to mitigate this vulnerability.
You can find more information about the fix for this vulnerability in the Linux Kernel source code repository. The fix was implemented in version v4.9.293, and the commit can be viewed at: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=60a55b9d91ba99eb8cf015bc46dc2de05e168a15
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.