Vulnerability in Kernel: Destroy I/O bus devices on unregister failure after sync'ing SRCU
Summary
GSD-2021-1000395: KVM: Destroy I/O bus devices on unregister failure _after_ sync'ing SRCU. Affects Kernel versions >= f65886606c2d3b562716de030706dfe1bea4ed5e, < 03c6cccedd3913006744faa252a4da5145299343. 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 provides core functionality and interfaces with hardware devices. It manages system resources, facilitates communication between software and hardware, and ensures the stability and security of the system. This vulnerability affects the Kernel and specifically relates to the handling of I/O bus devices during the unregister process. The vulnerability allows for the improper destruction of these devices, potentially leading to security issues and system instability.
Vulnerability Detail
The vulnerability arises from a flaw in the unregister process of I/O bus devices in the Kernel. When unregistering these devices, the destruction process is not properly synchronized with the SRCU (Synchronizing RCU) mechanism. As a result, the destruction of I/O bus devices may occur before the SRCU synchronization, leading to potential use-after-free vulnerabilities and other security concerns. An attacker could potentially exploit this vulnerability to execute arbitrary code, escalate privileges, or cause a denial-of-service condition.
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 a patch provided by the Linux Kernel community. The patch modifies the unregister process to ensure proper synchronization with the SRCU mechanism. Here is an example of the patch code:
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -1236,6 +1236,7 @@ static void __device_release_driver(struct device *dev, void *data)
kfree(dev);
}
+srcu_sync(&bus->devices_srcu);
bus_for_each_dev(bus, NULL, NULL, __device_release_driver);
}
Conclusion
The vulnerability in the Kernel, related to the destruction of I/O bus devices during the unregister process, poses significant security risks. It is crucial to update the Kernel to the fixed version (v5.10.37 or later) to mitigate these risks. Users can also apply a provided patch as a temporary workaround. For further assistance and support in addressing this vulnerability, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
This vulnerability can potentially allow an attacker to execute arbitrary code, escalate privileges, or cause a denial-of-service condition. It is crucial to update the Kernel to the fixed version to mitigate these risks.
You can use the Vulert Playground (https://vulert.com/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 specific issue.
Yes, a workaround is available in the form of a patch provided by the Linux Kernel community. Applying this patch modifies the unregister process to ensure proper synchronization with the SRCU mechanism. Please refer to the 'workaround' section for the patch code.
To update the Linux Kernel, you can visit the official Linux Kernel repository (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/) and download the latest stable version (v5.10.37 or later). Follow the installation instructions provided by the repository to update your Kernel installation.
You can find more information about this vulnerability, including the fix and its impact, in the vulnerability database maintained by the Cloud Security Alliance. The specific vulnerability entry can be accessed at the following link: https://github.com/cloudsecurityalliance/gsd-database/blob/main/2021/1000xxx/GSD-2021-1000395.json
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.