HIGH
drm/xe OA Config UAF
CVE-2025-71099
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: drm/xe/oa: Fix potential UAF in xe_oa_add_config_ioctl() In xe_oa_add_config_ioctl(), we accessed oa_config->id after dropping metrics_lock. Since this lock protects the lifetime of oa_config, an attacker could guess the id and call xe_oa_remove_config_ioctl() with perfect timing, freeing oa_config before we dereference it, leading to a potential use-after-free. Fix this by caching the id in a local variable while holding the lock. v2: (Matt A) - Dropped mutex_unlock(&oa->metrics_lock) ordering change from xe_oa_remove_config_ioctl() (cherry picked from commit 28aeaed130e8e587fd1b73b6d66ca41ccc5a1a31)
02KernelScan AI Analysis
Risk summary
An attacker with local access to the Intel Xe GPU driver could potentially cause memory corruption by exploiting a race condition in the OA (Observability Architecture) configuration management. The vulnerability allows freeing memory that is subsequently accessed, which could lead to system crashes or potentially arbitrary code execution with kernel privileges.
Vulnerability analysis
Root Cause: In xe_oa_add_config_ioctl(), the code accessed oa_config->id after releasing the metrics_lock mutex. Since this lock protects the lifetime of oa_config objects, a concurrent call to xe_oa_remove_config_ioctl() could free the oa_config structure between the mutex unlock and the subsequent access to oa_config->id, creating a use-after-free condition.
Attack Surface: This vulnerability requires local access with sufficient privileges to open the DRM device and call the xe_oa_add_config_ioctl() and xe_oa_remove_config_ioctl() functions. The attack requires precise timing to exploit the race condition between the mutex unlock and the id access.
Fix Mechanism: The fix caches the oa_config->id value in a local variable while still holding the metrics_lock, then uses this cached value after releasing the lock. This ensures the id is safely retrieved before any potential concurrent removal of the oa_config object.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.12 | 6.12.64 | c6d30b65b7a4 |
| 6.18 | 6.18.4 | 7cdb9a9da935 |
| mainline | 6.19 | dcb171931954 |