Fix error handling path in idxd_cdev_register() in dmaengine: idxd
Summary
GSD-2022-1003317: dmaengine: idxd: Fix the error handling path in idxd_cdev_register(). Affects Kernel versions >= 42d279f9137ab7d5503836baec2739284b278d8f, < b3c7b5d08e9d5b2ff31c03078c00ecf11042419f. 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 dmaengine package in the Linux Kernel provides a framework for managing DMA (Direct Memory Access) engines. DMA engines are hardware components that can transfer data between devices and memory without involving the CPU. The idxd_cdev_register() function is part of the idxd driver, which is responsible for managing Intel(R) Data Streaming Accelerator (Intel(R) DSA) devices. These devices offload data movement tasks from the CPU, improving system performance.
The idxd_cdev_register() function is used to register a character device for the idxd driver. This character device allows user-space applications to interact with the idxd driver and control the Intel(R) DSA devices. However, there is an error handling path in this function that is not properly implemented, leading to a vulnerability.
Vulnerability Detail
The vulnerability in dmaengine: idxd arises from an error handling path in the idxd_cdev_register() function. When an error occurs during the registration of the character device, the function does not properly clean up resources before returning, leading to a potential resource leak. This vulnerability could be exploited by an attacker to exhaust system resources, causing a denial-of-service condition. Additionally, if the leaked resources are reused, it may lead to further security issues.
The vulnerability was introduced in version v5.6 of the Linux Kernel by commit 42d279f9137ab7d5503836baec2739284b278d8f and is fixed in version v5.15.46 by commit b3c7b5d08e9d5b2ff31c03078c00ecf11042419f.
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 Linux Kernel is not immediately feasible, a possible workaround is to disable the idxd driver or remove the Intel(R) DSA devices from the system. This can be achieved by blacklisting the idxd module or modifying the system configuration to prevent the driver from loading. However, this workaround may impact the functionality of Intel(R) DSA devices and should be considered temporary until the Kernel can be updated.
Conclusion
The vulnerability in dmaengine: idxd's idxd_cdev_register() function can lead to resource leaks and potential denial-of-service conditions. It is recommended to update the Linux Kernel to version v5.15.46 or later to fix this vulnerability. If immediate updating is not possible, disabling the idxd driver or removing the Intel(R) DSA devices from the system can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
dmaengine: idxd is a driver in the Linux Kernel that manages Intel(R) Data Streaming Accelerator (Intel(R) DSA) devices. These devices offload data movement tasks from the CPU, improving system performance.
The vulnerability can lead to resource leaks and potential denial-of-service conditions. It may also introduce further security risks if the leaked resources are reused.
Updating the Linux Kernel to version v5.15.46 or later will fix the vulnerability. The necessary fix commit is b3c7b5d08e9d5b2ff31c03078c00ecf11042419f.
A possible workaround is to disable the idxd driver or remove the Intel(R) DSA devices from the system. However, this may impact the functionality of the devices and should be considered temporary.
For more information about this vulnerability, you can refer to the vulnerability database entry at https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1003xxx/GSD-2022-1003317.json
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.