Memory Leak in samples/landlock Package
Summary
GSD-2022-1001903: samples/landlock: Fix path_list memory leak. Affects Kernel versions < 20fbf100f84b9aeb9c91421abe1927bc152bc32b. 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 samples/landlock package is a part of the Linux Kernel ecosystem. It provides a set of sample programs and code snippets that demonstrate the usage of the Landlock security module in the Linux Kernel. Landlock is a security feature that allows fine-grained access control policies for processes. It restricts the capabilities and resources that a process can access, enhancing the overall security of the system.
Vulnerability Detail
The vulnerability identified in the samples/landlock package is related to a memory leak in the path_list component. When certain operations are performed, the path_list does not release allocated memory, leading to a gradual accumulation of memory over time. This can result in resource exhaustion and potential denial-of-service (DoS) scenarios. The vulnerability has been assigned the ID GSD-2022-1001903 and has been fixed in Linux Kernel version v5.15.33 by commit 20fbf100f84b9aeb9c91421abe1927bc152bc32b.
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 release the allocated memory in the path_list component after performing the operations that trigger the memory leak. This can be done by modifying the code to include the appropriate memory deallocation function calls. Here is an example of how the workaround can be implemented in C:
void free_path_list(struct path_list *list) {
struct path_node *current = list->head;
while (current != NULL) {
struct path_node *next = current->next;
free(current);
current = next;
}
free(list);
}
Please note that this workaround is temporary and it is still recommended to apply the official fix by updating the Linux Kernel.
Conclusion
In conclusion, the samples/landlock package in the Linux Kernel is vulnerable to a memory leak in the path_list component. This vulnerability can lead to resource exhaustion and potential denial-of-service scenarios. It is recommended to update the Linux Kernel to version v5.15.33 or later to fix this vulnerability. Alternatively, a temporary workaround can be implemented by manually releasing the allocated memory in the path_list component. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The samples/landlock package is a collection of sample programs and code snippets that demonstrate the usage of the Landlock security module in the Linux Kernel. It provides examples of how to implement fine-grained access control policies for processes.
Landlock is a security feature in the Linux Kernel that allows fine-grained access control policies for processes. It restricts the capabilities and resources that a process can access, enhancing the overall security of the system.
A memory leak occurs when a program fails to release allocated memory after it is no longer needed. This can lead to a gradual accumulation of memory over time, potentially causing resource exhaustion and performance issues.
The memory leak in the samples/landlock package can result in resource exhaustion and potential denial-of-service (DoS) scenarios. It can cause the system to run out of memory, impacting its stability and performance.
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 to the playground, and it will analyze the dependencies and alert you if any vulnerabilities, including this one, are found.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.