Vulnerability in drm/virtio package: NULL pointer dereference in virtio_gpu_array_put_free()
Summary
GSD-2022-1001943: drm/virtio: Ensure that objs is not NULL in virtio_gpu_array_put_free(). Affects Kernel versions >= 377f8331d0565e6f71ba081c894029a92d0c7e77, < b094fece3810c71ceee6f0921676cb65d4e68c5a. 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/virtio package is a component of the Linux Kernel that provides support for the VirtIO GPU driver. This driver enables virtualized graphics acceleration for virtual machines running on the VirtIO framework. The package includes various functions and data structures to manage GPU resources and perform operations on them.
Vulnerability Detail
The vulnerability identified in the drm/virtio package is a NULL pointer dereference in the virtio_gpu_array_put_free() function. This function is responsible for releasing GPU resources and freeing memory allocated for them. However, it fails to check if the 'objs' parameter is NULL before accessing it, leading to a potential crash or undefined behavior if called with a NULL pointer. An attacker could potentially exploit this vulnerability to cause a denial-of-service (DoS) condition or execute arbitrary code with kernel privileges.
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, developers can add a NULL check before calling the virtio_gpu_array_put_free() function to prevent the NULL pointer dereference. Here's an example code snippet:
if (objs != NULL) {
virtio_gpu_array_put_free(objs);
}
Conclusion
The vulnerability in the drm/virtio package's virtio_gpu_array_put_free() function poses a risk of crashing the Linux Kernel or allowing arbitrary code execution. To mitigate this vulnerability, it is recommended to update the Linux Kernel to version v5.15.32 or later. Alternatively, developers can apply a temporary workaround by adding a NULL check before calling the affected function. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability can potentially lead to a crash or undefined behavior in the Linux Kernel when the virtio_gpu_array_put_free() function is called with a NULL pointer. This could result in a denial-of-service (DoS) condition or allow an attacker to execute arbitrary code with kernel privileges.
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 to identify any open-source vulnerabilities, including this one.
Yes, a patch is available in the Linux Kernel version v5.15.32. By updating to this version or a later one, you can apply the fix for the NULL pointer dereference in virtio_gpu_array_put_free().
At the time of this report, there are no known exploits for this vulnerability. However, it is crucial to apply the patch or update to a fixed version to prevent potential exploitation.
Yes, as a temporary workaround, you can add a NULL check before calling the virtio_gpu_array_put_free() function to prevent the NULL pointer dereference. Please refer to the 'workaround' section for code example.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.