Skip to content

Commit 062d59e

Browse files
nirmoyrodrigovivi
authored andcommitted
drm/xe: Fix access_ok check in user_fence_create
Check size of the data not size of the pointer. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: ddeb798 ("drm/xe: Validate user fence during creation") Cc: Matthew Auld <[email protected]> Cc: Matthew Brost <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Reviewed-by: Tejas Upadhyay <[email protected]> Reviewed-by: Apoorva Singh <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Nirmoy Das <[email protected]> (cherry picked from commit e102b5e) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 5e2d1d4 commit 062d59e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_sync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr,
5555
struct xe_user_fence *ufence;
5656
u64 __user *ptr = u64_to_user_ptr(addr);
5757

58-
if (!access_ok(ptr, sizeof(ptr)))
58+
if (!access_ok(ptr, sizeof(*ptr)))
5959
return ERR_PTR(-EFAULT);
6060

6161
ufence = kmalloc(sizeof(*ufence), GFP_KERNEL);

0 commit comments

Comments
 (0)