Vulnerability in Kernel: nbd_cleanup() Function
Summary
GSD-2022-1003669: nbd: call genl_unregister_family() first in nbd_cleanup(). Affects Kernel versions < 1be608e1ee1f222464b2856bda9b85ab5184a33e. 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 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 →
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.