]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/xe/migrate: prevent potential UAF
authorMatthew Auld <matthew.auld@intel.com>
Thu, 31 Jul 2025 09:38:11 +0000 (10:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:34 +0000 (18:41 +0200)
commit7e46fa64a4b94208563c3a5bf1d7f4346f94abea
tree322992830749474d26cfe761772884c665147a72
parent7257cc6644d540130a46a61531a07a0517cace89
drm/xe/migrate: prevent potential UAF

[ Upstream commit 145832fbdd17b1d77ffd6cdd1642259e101d1b7e ]

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.

Fixes: 270172f64b11 ("drm/xe: Update xe_ttm_access_memory to use GPU for non-visible access")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Stuart Summers <stuart.summers@intel.com>
Link: https://lore.kernel.org/r/20250731093807.207572-8-matthew.auld@intel.com
(cherry picked from commit 9b7ca35ed28fe5fad86e9d9c24ebd1271e4c9c3e)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/xe/xe_migrate.c