projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69418db
)
drm/xe/ufence: Prefetch ufence addr to catch bogus address
author
Nirmoy Das
<nirmoy.das@intel.com>
Wed, 16 Oct 2024 08:23:03 +0000
(10:23 +0200)
committer
Lucas De Marchi
<lucas.demarchi@intel.com>
Thu, 24 Oct 2024 17:42:52 +0000
(12:42 -0500)
access_ok() only checks for addr overflow so also try to read the addr
to catch invalid addr sent from userspace.
Link:
https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1630
Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link:
https://patchwork.freedesktop.org/patch/msgid/20241016082304.66009-2-nirmoy.das@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
(cherry picked from commit
9408c4508483ffc60811e910a93d6425b8e63928
)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_sync.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/xe/xe_sync.c
b/drivers/gpu/drm/xe/xe_sync.c
index
c6cf227
..
2e72c06
100644
(file)
--- a/
drivers/gpu/drm/xe/xe_sync.c
+++ b/
drivers/gpu/drm/xe/xe_sync.c
@@
-54,8
+54,9
@@
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);
+ u64 __maybe_unused prefetch_val;
- if (
!access_ok(ptr, sizeof(*ptr)
))
+ if (
get_user(prefetch_val, ptr
))
return ERR_PTR(-EFAULT);
ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);