Skip to content

Commit 8b52d9b

Browse files
ShuichengLinrodrigovivi
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: Rodrigo Vivi <[email protected]>
1 parent 6282995 commit 8b52d9b

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
@@ -490,7 +490,7 @@ static int copy_mask(void __user **ptr,
490490

491491
if (copy_to_user(*ptr, topo, sizeof(*topo)))
492492
return -EFAULT;
493-
*ptr += sizeof(topo);
493+
*ptr += sizeof(*topo);
494494

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

0 commit comments

Comments
 (0)