Commit c2a68591 authored by Shuicheng Lin's avatar Shuicheng Lin Committed by Matt Roper
Browse files

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: dd08ebf6 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: default avatarShuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20260130043907.465128-2-shuicheng.lin@intel.com


Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
parent 568d9d0d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -487,7 +487,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;