summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2011-11-23 01:12:01 -0500
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-04-05 09:09:34 +0300
commita6e9dd49814f608da0b1d52ccc3b4b18aa6a0a61 (patch)
treeee2ecd830eb94eb83f4242247f93114e91f7efe7 /include/drm
parent8622f0ea16f1691519cf0f693f0cb9ae99daf583 (diff)
downloadkernel-mfld-blackbay-a6e9dd49814f608da0b1d52ccc3b4b18aa6a0a61.tar.gz
kernel-mfld-blackbay-a6e9dd49814f608da0b1d52ccc3b4b18aa6a0a61.tar.bz2
kernel-mfld-blackbay-a6e9dd49814f608da0b1d52ccc3b4b18aa6a0a61.zip
drm: integer overflow in drm_mode_dirtyfb_ioctl()
commit a5cd335165e31db9dbab636fd29895d41da55dd2 upstream. There is a potential integer overflow in drm_mode_dirtyfb_ioctl() if userspace passes in a large num_clips. The call to kmalloc would allocate a small buffer, and the call to fb->funcs->dirty may result in a memory corruption. Reported-by: Haogang Chen <haogangchen@gmail.com> Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_mode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 51380c0db82..7502435a370 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -410,6 +410,8 @@ struct drm_mode_fb_cmd2 {
#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
#define DRM_MODE_FB_DIRTY_FLAGS 0x03
+#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
+
/*
* Mark a region of a framebuffer as dirty.
*