CVE-2026-68384: drm/xe/vf: Fix VF CCS attach/detach race with in-flight BO moves

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026081045-CVE-2026-68384-69f1@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

drm/xe/vf: Fix VF CCS attach/detach race with in-flight BO moves

xe_bo_move() attaches VF CCS read/write batch buffers (BBs) to a BO
after it transitions NULL/SYSTEM -> TT, and detaches them after it
transitions TT -> SYSTEM. Both operations were done synchronously on
the CPU immediately after building the move's copy/clear fence,
without waiting for that fence to signal. This creates two races with
VF migration:

- Attach happens too late relative to the copy job it is meant to
  protect. If the copy job is submitted before the CCS BBs are
  attached, a VF migration event that pauses execution mid-copy can
  observe partially copied CCS metadata without the attach state
  needed to correctly save/restore it.

- Detach happens too early relative to the copy job that moves data
  out of TT. The CCS BBs are torn down right after the copy fence is
  obtained, while the actual blit may still be in flight. A VF
  migration event that pauses execution mid-copy can then race the
  save/restore path against the still-running blit, and the CCS BBs
  it would need to make sense of the paused state have already been
  removed.

Fix both races:

- Move the attach call to before the copy/clear job is submitted, so
  the CCS BBs are already registered by the time the copy runs. On
  attach failure, unwind and bail out of the move. xe_migrate_ccs_rw_copy()
  now takes the destination resource explicitly, since bo->ttm.resource
  is not updated to the new resource until after the move commits.

- Detach only after explicitly waiting for the copy fence to signal,
  instead of tearing down the CCS BBs immediately after obtaining it.

While here, also fix xe_sriov_vf_ccs_attach_bo() to properly unwind and
propagate errors: the per-context loop previously never broke out on
error, silently discarding earlier failures. Unwind by clearing each
attached context directly via xe_migrate_ccs_rw_copy_clear() instead of
reusing xe_sriov_vf_ccs_detach_bo(), which requires both contexts to be
attached before it will clean up either one.

(cherry picked from commit d45ad0aa7a1eb5d7288b5ed948b05695611dc39e)

The Linux kernel CVE team has assigned CVE-2026-68384 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 6.18 with commit 864690cf4dd62482b6dd049d82c509886c904303 and fixed in 6.18.42 with commit 35ba43b541117bfb595e4b807ba447cf4335cc7d
	Issue introduced in 6.18 with commit 864690cf4dd62482b6dd049d82c509886c904303 and fixed in 7.1.6 with commit f2ebfd5cc87f1393a30c8b8b0a6c20cb22cffa97
	Issue introduced in 6.18 with commit 864690cf4dd62482b6dd049d82c509886c904303 and fixed in 7.2-rc4 with commit 56441f9e08ad68697295b8835266d2bc48ab59b5

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-2026-68384
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_bo.c
	drivers/gpu/drm/xe/xe_migrate.c
	drivers/gpu/drm/xe/xe_migrate.h
	drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
	drivers/gpu/drm/xe/xe_sriov_vf_ccs.h


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/35ba43b541117bfb595e4b807ba447cf4335cc7d
	https://git.kernel.org/stable/c/f2ebfd5cc87f1393a30c8b8b0a6c20cb22cffa97
	https://git.kernel.org/stable/c/56441f9e08ad68697295b8835266d2bc48ab59b5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.