Vulnerability in Kernel: nbd_cleanup() Function

Kernel Updated 02 Oct 2025

Summary

28/06/2022
N/A
No i
Unrated
Not published

GSD-2022-1003669: nbd: call genl_unregister_family() first in nbd_cleanup(). Affects Kernel versions < 1be608e1ee1f222464b2856bda9b85ab5184a33e. 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 Kernel is a critical component of the Linux operating system that manages system resources and facilitates communication between hardware and software. It provides essential functionality for the proper functioning of the system. One of the features supported by the Kernel is the Network Block Device (NBD), which allows remote storage devices to be accessed as if they were local. The nbd_cleanup() function is responsible for cleaning up resources associated with the NBD module. However, a vulnerability has been discovered in this function that could potentially be exploited by attackers.

Vulnerability Detail

The vulnerability in the nbd_cleanup() function arises from the improper order of operations during cleanup. Specifically, the genl_unregister_family() function, which unregisters a generic netlink family, is not called before other cleanup operations. This oversight can lead to a use-after-free vulnerability, where a pointer to freed memory is still accessible and can be manipulated by an attacker. Exploiting this vulnerability could result in a variety of consequences, including remote code execution, privilege escalation, or denial of service.

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 by modifying the nbd_cleanup() function to ensure that genl_unregister_family() is called before other cleanup operations. The following code snippet demonstrates this workaround:

void nbd_cleanup()
{
    genl_unregister_family(&nbd_genl_family);
    // Other cleanup operations
}

Conclusion

The vulnerability in the nbd_cleanup() function of the Kernel poses a significant risk to system security. It is crucial to update the Kernel to version v5.4.198 or later to mitigate this vulnerability. If immediate updating is not possible, the provided workaround can be implemented. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

Exploiting this vulnerability could lead to serious consequences, including remote code execution, privilege escalation, or denial of service. It is crucial to address this vulnerability promptly.

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 one.

Yes, a patch is available in the Linux Kernel version v5.4.198. It is recommended to update to this version or a later one to fix the vulnerability.

Yes, a temporary workaround is available. You can modify the nbd_cleanup() function to ensure that genl_unregister_family() is called before other cleanup operations. Refer to the 'workaround' section for the code snippet.

You can find more information about this vulnerability, including its technical details and the fix, in the vulnerability report at https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1003xxx/GSD-2022-1003669.json.

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