summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShuicheng Lin <shuicheng.lin@intel.com>2026-01-30 04:39:08 +0000
committerRodrigo Vivi <rodrigo.vivi@intel.com>2026-02-05 08:03:35 -0500
commit8b52d9ba085f0e1fee30aa4d1e4948494047b5fe (patch)
tree6c63248df2005d5e7f633095b4beea4de021a059
parent628299518894a41c95ffbe465f80b8ce36830007 (diff)
drm/xe/query: Fix topology query pointer advance
The topology query helper advanced the user pointer by the size of the pointer, not the size of the structure. This can misalign the output blob and corrupt the following mask. Fix the increment to use sizeof(*topo). There is no issue currently, as sizeof(*topo) happens to be equal to sizeof(topo) on 64-bit systems (both evaluate to 8 bytes). Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patch.msgid.link/20260130043907.465128-2-shuicheng.lin@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit c2a6859138e7f73ad904be17dd7d1da6cc7f06b3) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_query.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 75490683bad2..f96f2844c5ba 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -490,7 +490,7 @@ static int copy_mask(void __user **ptr,
if (copy_to_user(*ptr, topo, sizeof(*topo)))
return -EFAULT;
- *ptr += sizeof(topo);
+ *ptr += sizeof(*topo);
if (copy_to_user(*ptr, mask, mask_size))
return -EFAULT;