In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: Fix fence put before wait in amdgpu_amdkfd_submit_ib
amdgpu_amdkfd_submit_ib() submits a GPU job and gets a fence
from amdgpu_ib_schedule(). This fence is used to wait for job
completion.
Currently, the code drops the fence reference using dma_fence_put()
before calling dma_fence_wait().
If dma_fence_put() releases the last reference, the fence may be
freed before dma_fence_wait() is called. This can lead to a
use-after-free.
Fix this by waiting on the fence first and releasing the reference
only after dma_fence_wait() completes.
Fixes the below:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:697 amdgpu_amdkfd_submit_ib() warn: passing freed memory 'f' (line 696)
(cherry picked from commit 8b9e5259adc385b61a6590a13b82ae0ac2bd3482)
CVE-2026-31566 is a use-after-free vulnerability in the Linux kernel's AMD GPU driver (amdgpu) affecting the amdgpu_amdkfd_submit_ib() function. The vulnerability occurs when a fence reference is released before waiting for job completion, potentially allowing the fence object to be freed while still in use. This could lead to kernel memory corruption, denial of service, or privilege escalation on systems with AMD GPUs.
IMMEDIATE ACTIONS:
1. Identify systems running Linux kernel versions 6.0 through 7.0-rc4 with AMD GPU drivers (amdgpu)
2. Check kernel version: uname -r
3. Verify AMD GPU presence: lspci | grep -i amd
PATCHING GUIDANCE:
1. Update to Linux kernel 7.0 final release or later
2. For RHEL/CentOS: yum update kernel
3. For Ubuntu/Debian: apt update && apt upgrade linux-image-generic
4. Apply the specific patch commit 8b9e5259adc385b61a6590a13b82ae0ac2bd3482 if kernel update unavailable
5. Reboot system after kernel update
COMPENSATING CONTROLS (if immediate patching unavailable):
1. Disable GPU compute workloads if not critical
2. Implement kernel module blacklisting: echo 'blacklist amdgpu' >> /etc/modprobe.d/blacklist.conf (if GPU not required)
3. Monitor system logs for kernel panics: journalctl -p err
4. Implement resource limits on GPU processes
DETECTION RULES:
1. Monitor kernel logs for: 'use-after-free', 'amdgpu_amdkfd_submit_ib', 'dma_fence'
2. Watch for unexpected kernel panics or GPU driver crashes
3. Alert on: dmesg | grep -i 'amdgpu\|fence\|use-after-free'
4. Enable kernel debugging: echo 1 > /proc/sys/kernel/printk
الإجراءات الفورية:
1. تحديد الأنظمة التي تعمل بإصدارات نواة Linux من 6.0 إلى 7.0-rc4 مع مشغلات AMD GPU (amdgpu)
2. التحقق من إصدار النواة: uname -r
3. التحقق من وجود AMD GPU: lspci | grep -i amd
إرشادات التصحيح:
1. التحديث إلى إصدار نواة Linux 7.0 النهائي أو أحدث
2. لـ RHEL/CentOS: yum update kernel
3. لـ Ubuntu/Debian: apt update && apt upgrade linux-image-generic
4. تطبيق التصحيح المحدد commit 8b9e5259adc385b61a6590a13b82ae0ac2bd3482 إذا لم يكن تحديث النواة متاحاً
5. إعادة تشغيل النظام بعد تحديث النواة
الضوابط البديلة (إذا لم يكن التصحيح الفوري متاحاً):
1. تعطيل أعباء عمل GPU الحسابية إذا لم تكن حرجة
2. تنفيذ إدراج وحدة النواة في القائمة السوداء: echo 'blacklist amdgpu' >> /etc/modprobe.d/blacklist.conf
3. مراقبة سجلات النظام للأعطال: journalctl -p err
4. تنفيذ حدود الموارد على عمليات GPU
قواعد الكشف:
1. مراقبة سجلات النواة عن: 'use-after-free', 'amdgpu_amdkfd_submit_ib', 'dma_fence'
2. مراقبة أعطال مشغل GPU غير المتوقعة
3. التنبيه على: dmesg | grep -i 'amdgpu\|fence\|use-after-free'
4. تفعيل تصحيح النواة: echo 1 > /proc/sys/kernel/printk