CVE-2026-98520 in Linuxinfo

Summary

by MITRE • 10/18/2026

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)

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 10/18/2026

The Linux kernel driver for AMD GPU Kernel Fusion Driver contains a critical memory management flaw within the kfd_dev_mapping subsystem that compromises system stability and security in virtualized environments utilizing Single Root I/O Virtualization. The vulnerability stems from an architectural decision to cache the address_space structure of only the first process opening the /dev/kfd device file. This cached pointer is utilized during GPU reset operations to invoke unmap_mapping_range, a function designed to invalidate all userspace memory mappings for doorbell and MMIO ranges associated with the GPU hardware. While this approach functions correctly in single-container scenarios, it introduces severe logical errors when multiple containers or virtual machines interact with the same physical GPU device concurrently. The core issue lies in the lifecycle mismatch between the cached pointer and the actual ownership of the underlying inode structures managed by different user-space processes across distinct container boundaries.

The first manifestation of this flaw is a use-after-free condition that can lead to a hard system hang or kernel panic. When the initial process, which opened /dev/kfd and established the cached address_space reference, terminates its session within its respective container, the associated inode may be released by the VFS layer if no other references exist. However, the kfd_dev_mapping structure retains this now-dangling pointer to the freed memory. Subsequently, when a GPU reset is triggered—often initiated by hardware errors or administrative commands—the kernel attempts to call unmap_mapping_range using this stale pointer. This operation requires acquiring the i_mmap_rwsem semaphore associated with the inode. Since the inode has already been freed and potentially reallocated for other purposes, accessing its synchronization primitives results in undefined behavior. In practice, this manifests as an uninterruptible wait on a corrupted rwsem structure, causing the GPU reset workqueue to hang indefinitely. This state is observable via NMI backtraces showing threads stuck in rwsem_down_read_slowpath, effectively freezing the device recovery process and potentially impacting other system functions dependent on that hardware resource.

The second vulnerability is a logical gap in memory unmapping known as multi-container isolation failure. Because only the address_space of the first opener is cached, any subsequent openers from different containers create virtual memory areas within their own distinct address_spaces. These later mappings are entirely invisible to the unmap_mapping_range call executed during GPU reset. Consequently, after a hardware reset or recovery event, stale user-space mappings for doorbell and MMIO pages remain active in guest operating systems that no longer have valid access to the underlying GPU hardware. This state allows guests to issue PCIe transactions against non-existent resources, leading to PCI bus timeouts, data corruption, or Non-Maskable Interrupt panics within the guest VMs. From a security perspective, this represents a significant breach of isolation boundaries in SRIOV deployments, as it permits potentially malicious or buggy user-space applications to interact with hardware state that should have been cleared, violating the principle of least privilege and secure device reset protocols.

To resolve these issues, the fix implements a centralized memory management strategy aligned with standards established by the DRM core subsystem. Instead of relying on per-opener inodes which are subject to individual process lifecycles, the driver now creates a private pseudo-filesystem at module initialization time. From this filesystem, it allocates a single anonymous inode that is owned by the kernel module itself rather than any specific user-space process. This ensures that the inode persists for the entire duration of the amdgpu module's presence in memory, eliminating the risk of premature deallocation and dangling pointers. During the kfd_open operation, every file descriptor opened to /dev/kfd is redirected to map against this central anonymous inode’s address_space. By consolidating all virtual memory areas into a single address space managed by a long-lived kernel object, the unmap_mapping_range function can now correctly iterate over and invalidate mappings from all containers simultaneously during GPU reset operations.

This remediation addresses fundamental weaknesses in resource lifecycle management that align with CWE-416 Use After Free and CWE-200 Exposure of Sensitive Information to Unauthorized Actors due to improper access control during state transitions. The vulnerability also relates to ATT&CK technique T1537, which involves transferring data between cloud accounts or virtual environments, as the failure to properly isolate memory mappings allows cross-container interference. By ensuring that all user-space mappings are tracked centrally and invalidated uniformly upon hardware reset, the patch restores proper isolation guarantees for SRIOV workloads. System administrators should apply this kernel update immediately in multi-tenant GPU computing environments to prevent potential denial-of-service conditions caused by hung kernels and to mitigate risks associated with stale memory access leading to system instability or unauthorized data exposure through PCIe transaction anomalies.

Responsible

Linux

Reservation

09/25/2026

Disclosure

10/18/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!