Memory Leak Vulnerability in ceph Package
Summary
GSD-2022-1001995: ceph: fix memory leak in ceph_readdir when note_last_dentry returns error. Affects Kernel versions < f4429786129648a8f4bb1e5faa143c4478cc5c4a. 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 ceph package is a distributed storage system that provides high-performance, scalable, and reliable storage for applications. It is commonly used in cloud computing environments to store and manage large amounts of data. The vulnerability in question is a memory leak issue that occurs in the ceph_readdir function when the note_last_dentry function returns an error. This vulnerability can potentially lead to a depletion of system memory resources, resulting in degraded performance or even system crashes.
Vulnerability Detail
The memory leak vulnerability in ceph_readdir arises when the note_last_dentry function encounters an error. This can happen due to various reasons, such as invalid directory entries or filesystem corruption. When an error occurs, the function fails to release the allocated memory, leading to a memory leak. If this vulnerability is exploited, an attacker could potentially cause a denial-of-service (DoS) condition by repeatedly triggering the error and exhausting system memory resources. Additionally, the memory leak could result in performance degradation over time. The vulnerability has been addressed in the Linux Kernel version v5.10.111 by commit f4429786129648a8f4bb1e5faa143c4478cc5c4a.
How To Fix
No fixed version is published for this vulnerability.
To fix the memory leak vulnerability in the ceph package, it is recommended to update the Linux Kernel to version v5.10.111 or later. This can be done by fetching the latest kernel source code from the official Linux Kernel repository (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/) and applying the commit f4429786129648a8f4bb1e5faa143c4478cc5c4a. After updating the kernel, rebuild and reinstall the ceph package to ensure the fix is applied.
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 by modifying the ceph_readdir function to handle the error condition properly and release the allocated memory. Here is an example code snippet that demonstrates the workaround:
// Modified ceph_readdir function with error handling
int ceph_readdir(struct file *file, struct dir_context *ctx)
{
// Existing code
...
// Error handling
if (note_last_dentry() < 0) {
// Release allocated memory
kfree(ctx->private);
return -EINVAL;
}
...
}
Conclusion
The memory leak vulnerability in the ceph package can have serious consequences, including system crashes and performance degradation. It is crucial to update the Linux Kernel to the recommended version or apply the provided workaround to mitigate the vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The ceph package is a distributed storage system used in cloud computing environments to provide scalable and reliable storage for applications.
The memory leak vulnerability in ceph can result in a depletion of system memory resources, leading to degraded performance or system crashes.
The memory leak vulnerability in ceph can be fixed by updating the Linux Kernel to version v5.10.111 or later.
Yes, a temporary workaround can be implemented by modifying the ceph_readdir function to handle the error condition properly and release the allocated memory.
More information about the vulnerability fix can be found in the Linux Kernel repository at https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f4429786129648a8f4bb1e5faa143c4478cc5c4a.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.