Null Return of kmalloc_array() in drm/amdkfd

Kernel Updated 02 Oct 2025

Summary

24/04/2022
N/A
No i
Unrated
Not published

GSD-2022-1002461: drm/amdkfd: Check for potential null return of kmalloc_array(). Affects Kernel versions < 32cf90a521dcc0f136db7ee5ba32bfe5f79e460e. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The drm/amdkfd package is a component of the Linux Kernel that provides support for AMD GPUs in the kernel's Direct Rendering Manager (DRM) subsystem. It includes the AMD Kernel Fusion Driver (KFD) which enables Heterogeneous System Architecture (HSA) functionality. The package allows for efficient communication between the CPU and GPU, facilitating tasks such as parallel computing and GPU acceleration. However, a vulnerability has been identified in the package that could potentially lead to security issues.

Vulnerability Detail

The vulnerability in drm/amdkfd arises from a failure to check for a potential null return of kmalloc_array(). This function is used to allocate memory for an array of objects. If the allocation fails and returns null, subsequent operations relying on this memory can lead to unexpected behavior, including crashes or the execution of arbitrary code. Attackers may be able to exploit this vulnerability to gain unauthorized access, escalate privileges, or cause denial of service.

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 the patch provided in the commit 32cf90a521dcc0f136db7ee5ba32bfe5f79e460e manually. The patch modifies the code in drm/amdkfd to include the necessary null return check for kmalloc_array(). Here is an example of the modified code:

// Original code
...
buffer = kmalloc_array(num_elements, sizeof(struct element), GFP_KERNEL);
...

// Modified code
...
buffer = kmalloc_array(num_elements, sizeof(struct element), GFP_KERNEL);
if (!buffer) {
    // Handle allocation failure
    return -ENOMEM;
}
...

Conclusion

The vulnerability in drm/amdkfd that fails to check for a potential null return of kmalloc_array() can lead to security issues, including unauthorized access, privilege escalation, or denial of service. It is crucial to update the Linux Kernel to version v4.9.311 or later, or apply the provided patch, to mitigate the risk. Users can also utilize the Vulert Playground at https://vulert.com/scanner to check if their system is affected by this vulnerability. For further support, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The vulnerability could potentially allow attackers to gain unauthorized access, escalate privileges, or cause denial of service. It is important to update the Linux Kernel to mitigate the risk.

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 and the playground will analyze it for open-source vulnerabilities in real-time.

At the time of this report, no known exploits have been reported for this specific vulnerability. However, it is crucial to apply the recommended fix or workaround to prevent potential exploitation.

The vulnerability itself does not provide remote exploitation capabilities. However, if an attacker already has access to the affected system, they may be able to exploit the vulnerability to escalate privileges or perform other malicious actions.

For further support on vulnerability remediation, you can reach out to info@devnack.com. Our team will be happy to assist you in addressing any concerns or questions you may have.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback