Vulnerability in drm/amdgpu Package: Off-by-One Error in amdgpu_gfx_kiq_acquire()

Kernel Updated 02 Oct 2025

Summary

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

GSD-2022-1001987: drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire(). Affects Kernel versions >= 71c37505e7eaa01fa259debad1a71a7ae061039d, < 0c122eb3a109356fb2c39f49c1768321248d0f1d. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The drm/amdgpu package is a component of the Linux Kernel that provides support for AMD Radeon GPUs. It includes the amdgpu driver, which is responsible for managing the graphics processing unit. The amdgpu_gfx_kiq_acquire() function is a critical part of the driver that handles acquiring the Kernel Interface Queue (KIQ) for GPU communication. This vulnerability is an off-by-one error in the amdgpu_gfx_kiq_acquire() function, which can lead to potential security issues.

Vulnerability Detail

The off-by-one error in amdgpu_gfx_kiq_acquire() allows an attacker to overwrite adjacent memory locations, potentially leading to memory corruption, privilege escalation, or arbitrary code execution. By exploiting this vulnerability, an attacker could gain unauthorized access to the system or cause a denial-of-service (DoS) condition. The vulnerability was introduced in version v4.13 of the Linux Kernel and is fixed in version v5.10.111.

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 fix commit (0c122eb3a109356fb2c39f49c1768321248d0f1d) manually. The patch modifies the amdgpu_gfx_kiq_acquire() function to correct the off-by-one error. Here is the code snippet for the patch:

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -1234,7 +1234,7 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_ring *ring)
 		return -EBUSY;
 
 	spin_lock(&ring->sched.lock);
-	for (i = 0; i <= AMDGPU_MAX_KIQ_REG_WAIT; ++i) {
+	for (i = 0; i < AMDGPU_MAX_KIQ_REG_WAIT; ++i) {
 		if (amdgpu_ring_lockup(ring)) {
 			spin_unlock(&ring->sched.lock);
 			return -EBUSY;

Conclusion

In conclusion, the drm/amdgpu package in the Linux Kernel is vulnerable to an off-by-one error in the amdgpu_gfx_kiq_acquire() function. This vulnerability can have severe consequences, including unauthorized access, code execution, or DoS attacks. It is crucial to update the Linux Kernel to version v5.10.111 or later to mitigate the risk. Additionally, applying the provided patch or regularly updating the system with security patches is recommended. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

This vulnerability can potentially allow an attacker to gain unauthorized access to the system, execute arbitrary code, or cause a denial-of-service (DoS) condition.

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 one.

Yes, a workaround is available. Users can manually apply the patch provided in the fix commit to address the vulnerability.

At the time of this report, there are no known exploits for this vulnerability. However, it is crucial to apply the necessary fixes and updates to mitigate the risk.

For more information about this vulnerability, you can refer to the source link in the database_specific section of the vulnerability details (https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1001xxx/GSD-2022-1001987.json).

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