{"id":40992,"date":"2026-10-19T00:31:46","date_gmt":"2026-10-18T16:31:46","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-98520"},"modified":"2026-10-19T00:31:46","modified_gmt":"2026-10-18T16:31:46","slug":"cve-2026-98520","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-98520","title":{"rendered":"CVE-2026-98520 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\ndrm\/amdkfd: fix use-a"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>drm\/amdkfd: fix use-after-free and multi-container gap in kfd_dev_mapping<\/p>\n<p>kfd_dev_mapping caches the address_space of the first \/dev\/kfd opener<br \/>\nso that the GPU reset path can call unmap_mapping_range() to zap all<br \/>\nuserspace mappings of doorbell and MMIO ranges.  This design has two<br \/>\nbugs that both manifest under SRIOV with multiple containers:<\/p>\n<p>1. Use-after-free \/ rwsem deadlock.  The cached pointer refers to an<br \/>\n   inode owned by the first opener&#8217;s container.  When that container<br \/>\n   exits and its inode is released, kfd_dev_mapping becomes a dangling<br \/>\n   pointer.  A subsequent GPU reset dereferences it inside<br \/>\n   unmap_mapping_range(), which takes i_mmap_rwsem on the freed inode,<br \/>\n   causing a hard hang observable as an uninterruptible rwsem wait.<\/p>\n<p>2. Multi-container gap.  Only the first opener&#8217;s address_space is cached;<br \/>\n   VMAs created by later openers live in a different address_space and<br \/>\n   are never reached by unmap_mapping_range().  After a GPU reset those<br \/>\n   stale mappings keep doorbell and MMIO pages accessible to guest<br \/>\n   userspace with no GPU behind them, risking PCIe transaction timeouts<br \/>\n   and NMI panics.<\/p>\n<p>Fix both bugs with the same approach used by DRM core (drm_drv.c):<br \/>\ncreate a private pseudo-filesystem at module init time and allocate one<br \/>\nanonymous inode from it.  In kfd_open() redirect every opener&#8217;s<br \/>\nfile-&gt;f_mapping to that inode&#8217;s address_space.  The inode is<br \/>\nmodule-owned, lives exactly as long as the amdgpu module, and collects<br \/>\nVMAs from all openers in one address_space.  A single<br \/>\nunmap_mapping_range() call in the reset path then correctly reaches<br \/>\nevery container&#8217;s mappings with no dangling pointer risk.<\/p>\n<p>The hang manifests as an NMI backtrace on the GPU reset workqueue stuck<br \/>\nspinning in rwsem_down_read_slowpath() with a corrupted i_mmap_rwsem:<\/p>\n<p>  Workqueue: amdgpu-reset-dev xgpu_ai_mailbox_flr_work [amdgpu]<br \/>\n  Call Trace:<\/p>\n<p>   kvm_wait+0x1f\/0x40<br \/>\n   __pv_queued_spin_lock_slowpath+0x31d\/0x3a0<br \/>\n   _raw_spin_lock_irq+0x51\/0x80<br \/>\n   rwsem_down_read_slowpath+0xb3\/0x550<br \/>\n   down_read+0x48\/0xd0<br \/>\n   unmap_mapping_range+0x71\/0x140<br \/>\n   kfd_dev_unmap_mapping_range+0x5b\/0x140 [amdgpu]<br \/>\n   amdgpu_amdkfd_clear_kfd_mapping+0xd8\/0x190 [amdgpu]<br \/>\n   amdgpu_device_gpu_recover+0x232\/0x450 [amdgpu]<br \/>\n   xgpu_ai_mailbox_flr_work+0xb5\/0xc0 [amdgpu]<br \/>\n   process_one_work+0x18e\/0x3e0<br \/>\n   worker_thread+0x2e3\/0x420<br \/>\n   kthread+0x10a\/0x230<\/p>\n<p>(cherry picked from commit 1128b4a52de1572e87431de837fd9850cb99542c)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>drm\/amdkfd: fix use-after-free and multi-container gap in kfd_dev_mapping<\/p>\n<p>kfd_dev_mapping caches the address_space of the first \/d<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-40992","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/40992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}