Commit 31b684e8 authored by Daniel Vetter's avatar Daniel Vetter Committed by Kamal Mostafa

drm: Reject page_flip for !DRIVER_MODESET

BugLink: http://bugs.launchpad.net/bugs/1624037

commit 6f00975c upstream.

Somehow this one slipped through, which means drivers without modeset
support can be oopsed (since those also don't call
drm_mode_config_init, which means the crtc lookup will chase an
uninitalized idr).
Reported-by: default avatarAlexander Potapenko <glider@google.com>
Cc: Alexander Potapenko <glider@google.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent d98d7f10
...@@ -5289,6 +5289,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, ...@@ -5289,6 +5289,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS || if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS ||
page_flip->reserved != 0) page_flip->reserved != 0)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment