USB: usbfs: Don't WARN about excessively large memory allocations in Kernel
Summary
GSD-2021-1000561: USB: usbfs: Don't WARN about excessively large memory allocations. Affects Kernel versions < 9f7cb3f01a10d9064cf13b3d26fb7e7a5827d098. 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 the system's resources and facilitates communication between hardware and software. It provides essential functionalities such as process management, memory management, and device drivers. The USB subsystem in the Kernel allows devices to be connected and interact with the system. However, a vulnerability has been identified in the usbfs module of the Kernel, which can lead to excessive memory allocations.
Vulnerability Detail
The usbfs module in the Kernel triggers a WARN message when it encounters excessively large memory allocations. This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition on the system. By repeatedly requesting large memory allocations, an attacker can exhaust the available memory resources, leading to system instability or crashes. This vulnerability has the potential to impact the overall availability and reliability of the system.
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 temporary workaround, users can apply a patch provided by the Kernel community. Here is an example of the patch:
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1309,7 +1309,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps,
&urb->transfer_flags))
goto exit;
- if (urb->transfer_buffer_length > INT_MAX) {
+ if (urb->transfer_buffer_length > INT_MAX || urb->transfer_buffer_length < 0) {
retval = -EINVAL;
goto exit;
}
Conclusion
In conclusion, the USB: usbfs vulnerability in the Kernel can result in a denial-of-service (DoS) condition on the system. It is crucial to update the Kernel to the latest version to mitigate this vulnerability. Applying the provided workaround patch can serve as a temporary solution until the update is applied. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
This vulnerability can lead to a denial-of-service (DoS) condition on the system, potentially causing system instability or crashes.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Simply upload your manifest file (e.g., package-lock.json) to the playground, and it will provide real-time alerts for open-source vulnerabilities, including this one.
Yes, this vulnerability has been fixed in Linux Kernel version v5.12.9 by commit 9f7cb3f01a10d9064cf13b3d26fb7e7a5827d098.
To protect your system, it is recommended to update your Kernel to the latest version available. Follow the installation instructions provided by the Kernel developers to apply the update.
Yes, a temporary workaround is to apply a patch provided by the Kernel community. The patch can be found in the 'workaround' section of this report.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.