]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/dma-buf: fix UAF with retry loop
authorMatthew Auld <matthew.auld@intel.com>
Fri, 8 May 2026 10:26:37 +0000 (11:26 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Mon, 11 May 2026 20:46:18 +0000 (16:46 -0400)
commit155a372a1cc50fa93387c5d3cdfd614a61e1afd1
tree8bee537ac2598c2bda34e156709a6005af9e2f22
parent981bedbbe61364fcc3a3b87ebaf648a66cd07108
drm/xe/dma-buf: fix UAF with retry loop

Retry doesn't work here, since bo will be freed on error, leading to
UAF. However, now that we do the alloc & init before the attach, we can
now combine this as one unit and have the init do the alloc for us. This
should make the retry safe.

Reported by Sashiko.

v2: Fix up the error unwind (CI)

Closes: https://sashiko.dev/#/patchset/20260506184332.86743-2-matthew.auld%40intel.com
Fixes: eb289a5f6cc6 ("drm/xe: Convert xe_dma_buf.c for exhaustive eviction")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: <stable@vger.kernel.org> # v6.18+
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/20260508102635.149172-4-matthew.auld@intel.com
(cherry picked from commit 479669418253e0f27f8cf5db01a731352ea592e7)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_dma_buf.c