mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
drm/i915/userptr: reject zero user_size
Operating on a zero sized GEM userptr object will lead to explosions. Fixes:5cc9ed4b9a("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl") Testcase: igt/gem_userptr_blits/input-checking Signed-off-by: Matthew Auld <[email protected]> Cc: Chris Wilson <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commitc11c7bfd21) Signed-off-by: Joonas Lahtinen <[email protected]>
This commit is contained in:
parent
67b8d5c708
commit
20943f9849
1 changed files with 3 additions and 0 deletions
|
|
@ -778,6 +778,9 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
|
|||
I915_USERPTR_UNSYNCHRONIZED))
|
||||
return -EINVAL;
|
||||
|
||||
if (!args->user_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (offset_in_page(args->user_ptr | args->user_size))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue