Skip to content

Commit 7ee9b3e

Browse files
ShuichengLinThomas Hellström
authored andcommitted
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: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Shuicheng Lin <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Matt Roper <[email protected]> (cherry picked from commit c2a6859) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 8a44241 commit 7ee9b3e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/xe/xe_query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static int copy_mask(void __user **ptr,
491491

492492
if (copy_to_user(*ptr, topo, sizeof(*topo)))
493493
return -EFAULT;
494-
*ptr += sizeof(topo);
494+
*ptr += sizeof(*topo);
495495

496496
if (copy_to_user(*ptr, mask, mask_size))
497497
return -EFAULT;

0 commit comments

Comments
 (0)