Memory Leak in samples/landlock Package

Kernel Updated 02 Oct 2025

Summary

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

GSD-2022-1001903: samples/landlock: Fix path_list memory leak. Affects Kernel versions < 20fbf100f84b9aeb9c91421abe1927bc152bc32b. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 →

Share this vulnerability

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.

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