• Thierry Reding's avatar
    drm/rcar: gem: dumb: pitch is an output · 7e295a36
    Thierry Reding authored
    When creating a dumb buffer object using the DRM_IOCTL_MODE_CREATE_DUMB
    IOCTL, only the width, height, bpp and flags fields are inputs. The
    caller is not guaranteed to zero out or set handle, pitch and size.
    Drivers must not treat these values as possible inputs, otherwise they
    may use uninitialized memory during the computation of the framebuffer
    size.
    
    The R-Car DU driver treats the pitch passed in from userspace as minimum
    and will only overwrite it when the driver-computed pitch is larger,
    allowing userspace to, intentionally or not, overallocate framebuffers.
    
    Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    7e295a36
rcar_du_kms.c 11.4 KB