lkml.org 
[lkml]   [2018]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 06/47] drm/i915/userptr: reject zero user_size
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Matthew Auld <matthew.auld@intel.com>

    commit c11c7bfd213495784b22ef82a69b6489f8d0092f upstream.

    Operating on a zero sized GEM userptr object will lead to explosions.

    Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
    Testcase: igt/gem_userptr_blits/input-checking
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Link: https://patchwork.freedesktop.org/patch/msgid/20180502195021.30900-1-matthew.auld@intel.com
    Cc: Loic <hackurx@opensec.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/gpu/drm/i915/i915_gem_userptr.c | 3 +++
    1 file changed, 3 insertions(+)

    --- a/drivers/gpu/drm/i915/i915_gem_userptr.c
    +++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
    @@ -842,6 +842,9 @@ i915_gem_userptr_ioctl(struct drm_device
    I915_USERPTR_UNSYNCHRONIZED))
    return -EINVAL;

    + if (!args->user_size)
    + return -EINVAL;
    +
    if (offset_in_page(args->user_ptr | args->user_size))
    return -EINVAL;


    \
     
     \ /
      Last update: 2018-09-07 23:54    [W:3.194 / U:0.548 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site