diff options
author | Nirmoy Das <[email protected]> | 2024-08-06 13:07:22 +0200 |
---|---|---|
committer | Nirmoy Das <[email protected]> | 2024-08-07 10:44:32 +0200 |
commit | e102b5ed6e283a144793cab8fcd95f61d0ddbadb (patch) | |
tree | ebfea5d5a2b0b0b3711825fcc48a1d723deecfa7 | |
parent | b62ef7e4021f74bb12445987efd8109ccca289c4 (diff) |
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: 0fde907da2d5 ("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]>
-rw-r--r-- | drivers/gpu/drm/xe/xe_sync.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c index 3aa6270e5dd7..ca826aeb41ea 100644 --- a/drivers/gpu/drm/xe/xe_sync.c +++ b/drivers/gpu/drm/xe/xe_sync.c @@ -55,7 +55,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr, struct xe_user_fence *ufence; u64 __user *ptr = u64_to_user_ptr(addr); - if (!access_ok(ptr, sizeof(ptr))) + if (!access_ok(ptr, sizeof(*ptr))) return ERR_PTR(-EFAULT); ufence = kmalloc(sizeof(*ufence), GFP_KERNEL); |