Null Return of kmalloc_array() in drm/amdkfd
Summary
GSD-2022-1002163: drm/amdkfd: Check for potential null return of kmalloc_array(). Affects Kernel versions < c7a268b33882d5feaafd29c1734456f41ba41396. 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 drm/amdkfd package is a component of the Linux Kernel that provides support for AMD GPUs in the Heterogeneous System Architecture (HSA). It allows for the management and communication between the CPU and GPU, enabling tasks to be offloaded to the GPU for improved performance. The package is critical for AMD GPU functionality in Linux systems.
Vulnerability Detail
The vulnerability in drm/amdkfd arises from a lack of proper error handling when calling the kmalloc_array() function. This function is used to allocate memory for an array, and if the allocation fails, it returns a null pointer. However, the code in drm/amdkfd does not check for this potential null return, which can lead to subsequent null pointer dereferences and crashes. An attacker could potentially exploit this vulnerability to cause a denial of service (DoS) or execute arbitrary code with kernel privileges.
How To Fix
No fixed version is published for this vulnerability.
To fix this vulnerability, it is necessary to update the Linux Kernel to version v5.4.190 or later. This update includes the commit c7a268b33882d5feaafd29c1734456f41ba41396, which addresses the issue by adding proper error handling to check for the null return of kmalloc_array(). Users should ensure they are running a version of the Linux Kernel that includes this fix.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the fix by updating the Linux Kernel.
Conclusion
The vulnerability in drm/amdkfd that allows for a potential null return of kmalloc_array() can lead to null pointer dereferences and crashes, posing a risk of denial of service (DoS) or arbitrary code execution with kernel privileges. It is crucial to update the Linux Kernel to version v5.4.190 or later to address this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability can lead to null pointer dereferences and crashes, potentially resulting in a denial of service (DoS) or arbitrary code execution with kernel privileges.
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 to the playground, and it will provide real-time alerts for open-source vulnerabilities, including this one.
At the time of this report, there is no known exploit for this vulnerability. However, it is important to apply the fix to prevent potential exploitation.
This vulnerability requires local access to the system to exploit. It cannot be exploited remotely over a network.
The only mitigation for this vulnerability is to update the Linux Kernel to a version that includes the fix.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.