Description
In the Linux kernel, the following vulnerability has been resolved:

drm/amdkfd: fix use-after-free and multi-container gap in kfd_dev_mapping

kfd_dev_mapping caches the address_space of the first /dev/kfd opener
so that the GPU reset path can call unmap_mapping_range() to zap all
userspace mappings of doorbell and MMIO ranges. This design has two
bugs that both manifest under SRIOV with multiple containers:

1. Use-after-free / rwsem deadlock. The cached pointer refers to an
inode owned by the first opener's container. When that container
exits and its inode is released, kfd_dev_mapping becomes a dangling
pointer. A subsequent GPU reset dereferences it inside
unmap_mapping_range(), which takes i_mmap_rwsem on the freed inode,
causing a hard hang observable as an uninterruptible rwsem wait.

2. Multi-container gap. Only the first opener's address_space is cached;
VMAs created by later openers live in a different address_space and
are never reached by unmap_mapping_range(). After a GPU reset those
stale mappings keep doorbell and MMIO pages accessible to guest
userspace with no GPU behind them, risking PCIe transaction timeouts
and NMI panics.

Fix both bugs with the same approach used by DRM core (drm_drv.c):
create a private pseudo-filesystem at module init time and allocate one
anonymous inode from it. In kfd_open() redirect every opener's
file->f_mapping to that inode's address_space. The inode is
module-owned, lives exactly as long as the amdgpu module, and collects
VMAs from all openers in one address_space. A single
unmap_mapping_range() call in the reset path then correctly reaches
every container's mappings with no dangling pointer risk.

The hang manifests as an NMI backtrace on the GPU reset workqueue stuck
spinning in rwsem_down_read_slowpath() with a corrupted i_mmap_rwsem:

Workqueue: amdgpu-reset-dev xgpu_ai_mailbox_flr_work [amdgpu]
Call Trace:
<TASK>
kvm_wait+0x1f/0x40
__pv_queued_spin_lock_slowpath+0x31d/0x3a0
_raw_spin_lock_irq+0x51/0x80
rwsem_down_read_slowpath+0xb3/0x550
down_read+0x48/0xd0
unmap_mapping_range+0x71/0x140
kfd_dev_unmap_mapping_range+0x5b/0x140 [amdgpu]
amdgpu_amdkfd_clear_kfd_mapping+0xd8/0x190 [amdgpu]
amdgpu_device_gpu_recover+0x232/0x450 [amdgpu]
xgpu_ai_mailbox_flr_work+0xb5/0xc0 [amdgpu]
process_one_work+0x18e/0x3e0
worker_thread+0x2e3/0x420
kthread+0x10a/0x230

(cherry picked from commit 1128b4a52de1572e87431de837fd9850cb99542c)
Published: 2026-10-18
Score: n/a
EPSS: n/a
KEV: No
Impact: Denial of Service / System Hang
Action: Apply Patch
AI Analysis

Impact

The vulnerability arises in the Linux kernel's AMDGPU kernel driver (amdkfd). A cached address_space for the first open of /dev/kfd is used by the GPU reset path to unmap user‑space mappings. When multiple containers use SRIOV, the cache may refer to an inode owned by the first container that later exits. The freed inode leads to a use‑after‑free when the GPU reset attempts to unmap, causing a rwsem deadlock and a hard hang observable as a non‑interruptible NMI wait. In another scenario, only the first container's mappings are cleared, leaving later containers’ doorbell and MMIO pages dangling, which can produce PCIe transaction timeouts and NMI panics. The impact is a denial of service that can lock the entire system or kernel.

Affected Systems

This issue affects systems running the Linux kernel that use the amdgpu kernel module in environments employing SRIOV with multiple containers. The fix concerns the amdkfd module and is applied at kernel version containing commit 1128b4a52de1572e87431de837fd9850cb99542c. No specific affected kernel releases are enumerated in the advisory; users should verify whether their kernel includes the stated commit.

Risk and Exploitability

The vulnerability requires privileged kernel execution in a SRIOV context and access to /dev/kfd. Exploitation would trigger only during a GPU reset, which is typically performed by the driver during fault recovery or power management, rather than arbitrary code execution. The EPSS score is not available, and it is not listed in the CISA KEV catalog. Despite the lack of a quantified risk metric, the potential for a hard kernel hang and uninterruptible wait makes the severity high for environments that rely on GPU stability. The attack vector is likely local, i.e., an attacker with control over container lifecycle or GPU reset operations.

Generated by OpenCVE AI on October 18, 2026 at 17:32 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that includes commit 1128b4a52de1572e87431de837fd9850cb99542c and enable the patched amdgpu module.
  • If a kernel upgrade cannot be applied immediately, ensure that all containers have closed /dev/kfd before initiating a GPU reset to avoid dangling mappings.
  • Monitor kernel logs for NMI backtraces or uninterruptible wait messages that indicate a GPU reset deadlock, and intervene by resetting the GPU or rebooting the host if necessary.

Generated by OpenCVE AI on October 18, 2026 at 17:32 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sun, 18 Oct 2026 18:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Sun, 18 Oct 2026 15:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: fix use-after-free and multi-container gap in kfd_dev_mapping kfd_dev_mapping caches the address_space of the first /dev/kfd opener so that the GPU reset path can call unmap_mapping_range() to zap all userspace mappings of doorbell and MMIO ranges. This design has two bugs that both manifest under SRIOV with multiple containers: 1. Use-after-free / rwsem deadlock. The cached pointer refers to an inode owned by the first opener's container. When that container exits and its inode is released, kfd_dev_mapping becomes a dangling pointer. A subsequent GPU reset dereferences it inside unmap_mapping_range(), which takes i_mmap_rwsem on the freed inode, causing a hard hang observable as an uninterruptible rwsem wait. 2. Multi-container gap. Only the first opener's address_space is cached; VMAs created by later openers live in a different address_space and are never reached by unmap_mapping_range(). After a GPU reset those stale mappings keep doorbell and MMIO pages accessible to guest userspace with no GPU behind them, risking PCIe transaction timeouts and NMI panics. Fix both bugs with the same approach used by DRM core (drm_drv.c): create a private pseudo-filesystem at module init time and allocate one anonymous inode from it. In kfd_open() redirect every opener's file->f_mapping to that inode's address_space. The inode is module-owned, lives exactly as long as the amdgpu module, and collects VMAs from all openers in one address_space. A single unmap_mapping_range() call in the reset path then correctly reaches every container's mappings with no dangling pointer risk. The hang manifests as an NMI backtrace on the GPU reset workqueue stuck spinning in rwsem_down_read_slowpath() with a corrupted i_mmap_rwsem: Workqueue: amdgpu-reset-dev xgpu_ai_mailbox_flr_work [amdgpu] Call Trace: <TASK> kvm_wait+0x1f/0x40 __pv_queued_spin_lock_slowpath+0x31d/0x3a0 _raw_spin_lock_irq+0x51/0x80 rwsem_down_read_slowpath+0xb3/0x550 down_read+0x48/0xd0 unmap_mapping_range+0x71/0x140 kfd_dev_unmap_mapping_range+0x5b/0x140 [amdgpu] amdgpu_amdkfd_clear_kfd_mapping+0xd8/0x190 [amdgpu] amdgpu_device_gpu_recover+0x232/0x450 [amdgpu] xgpu_ai_mailbox_flr_work+0xb5/0xc0 [amdgpu] process_one_work+0x18e/0x3e0 worker_thread+0x2e3/0x420 kthread+0x10a/0x230 (cherry picked from commit 1128b4a52de1572e87431de837fd9850cb99542c)
Title drm/amdkfd: fix use-after-free and multi-container gap in kfd_dev_mapping
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-10-18T15:17:38.113Z

Reserved: 2026-09-25T10:25:14.354Z

Link: CVE-2026-98520

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-18T16:17:03.370

Modified: 2026-10-18T16:17:03.370

Link: CVE-2026-98520

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-18T17:45:06Z

Weaknesses