Commit 7c4eaca4 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz Committed by Dave Airlie

drm: Check for invalid cursor flags

Signed-off-by: default avatarJakob Bornecrantz <jakob@vmware.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 22f5d115
...@@ -1981,7 +1981,7 @@ int drm_mode_cursor_ioctl(struct drm_device *dev, ...@@ -1981,7 +1981,7 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET)) if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL; return -EINVAL;
if (!req->flags) if (!req->flags || (~DRM_MODE_CURSOR_FLAGS & req->flags))
return -EINVAL; return -EINVAL;
mutex_lock(&dev->mode_config.mutex); mutex_lock(&dev->mode_config.mutex);
......
...@@ -359,8 +359,9 @@ struct drm_mode_mode_cmd { ...@@ -359,8 +359,9 @@ struct drm_mode_mode_cmd {
struct drm_mode_modeinfo mode; struct drm_mode_modeinfo mode;
}; };
#define DRM_MODE_CURSOR_BO (1<<0) #define DRM_MODE_CURSOR_BO 0x01
#define DRM_MODE_CURSOR_MOVE (1<<1) #define DRM_MODE_CURSOR_MOVE 0x02
#define DRM_MODE_CURSOR_FLAGS 0x03
/* /*
* depending on the value in flags different members are used. * depending on the value in flags different members are used.
......
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