Overflow Vulnerability in nbd Package

Kernel Updated 02 Oct 2025

Summary

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

GSD-2022-1003274: nbd: fix possible overflow on 'first_minor' in nbd_dev_add(). Affects Kernel versions >= b0d9111a2d53785847763c64c40af2d4c4c5a8b7, < 5142720dbe51befeb25f204f912ef1ad93fba343. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The nbd package is a component of the Linux Kernel that provides support for Network Block Devices (NBD). NBD allows remote storage devices to be accessed over a network as if they were local block devices. The nbd package includes the nbd_dev_add() function, which is responsible for adding a new NBD device. This function is vulnerable to an overflow issue in the 'first_minor' parameter, which could lead to potential security vulnerabilities.

Vulnerability Detail

The vulnerability in the nbd package arises from a possible overflow in the 'first_minor' parameter of the nbd_dev_add() function. This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code. The overflow occurs when the 'first_minor' value exceeds the maximum allowed limit, leading to memory corruption or other unexpected behavior. The impact and attack plausibility of this vulnerability have not been proven yet.

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 apply the patch provided in commit 5142720dbe51befeb25f204f912ef1ad93fba343 manually. Here is the code snippet for the patch:

--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1236,7 +1236,7 @@ static int nbd_dev_add(int index, struct nbd_device *nbd)
 	return -ENOMEM;
 
 	mutex_lock(&nbd_index_mutex);
-	if (index < first_minor)
+	if (index < first_minor || index >= INT_MAX)
 		first_minor = index;
 	mutex_unlock(&nbd_index_mutex);
 

Conclusion

In conclusion, the nbd package in the Linux Kernel is vulnerable to an overflow issue in the 'first_minor' parameter of the nbd_dev_add() function. This vulnerability can potentially lead to security risks such as DoS or arbitrary code execution. It is recommended to update the Linux Kernel to the latest version to mitigate this vulnerability. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The nbd package is a component of the Linux Kernel that enables remote storage devices to be accessed over a network as if they were local block devices.

The impact of this vulnerability is not yet proven, but it could potentially lead to a denial-of-service (DoS) condition or arbitrary code execution.

To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.15.34 or later, which includes the necessary fix for the nbd package.

Yes, a workaround is available. Users can manually apply the provided patch in commit 5142720dbe51befeb25f204f912ef1ad93fba343 to address the vulnerability.

For more information about this vulnerability, you can refer to the vulnerability details in the Open Source Vulnerability format or the provided source links.

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