CVE-2025-39740: drm/xe/migrate: prevent potential UAF
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
drm/xe/migrate: prevent potential UAF
If we hit the error path, the previous fence (if there is one) has already been put() prior to this, so doing a fence_wait could lead to UAF. Tweak the flow to do to the put() until after we do the wait.
(cherry picked from commit 9b7ca35ed28fe5fad86e9d9c24ebd1271e4c9c3e)
The Linux kernel CVE team has assigned CVE-2025-39740 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.16 with commit 270172f64b114451876c1b68912653e72ab99f38 and fixed in 6.16.2 with commit 7e46fa64a4b94208563c3a5bf1d7f4346f94abea Issue introduced in 6.16 with commit 270172f64b114451876c1b68912653e72ab99f38 and fixed in 6.17-rc2 with commit 145832fbdd17b1d77ffd6cdd1642259e101d1b7e
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-39740
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/gpu/drm/xe/xe_migrate.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/7e46fa64a4b94208563c3a5bf1d7f4346f94abea https://git.kernel.org/stable/c/145832fbdd17b1d77ffd6cdd1642259e101d1b7e