drm: integer overflow in vmw_kms_update_layout_ioctl()
Subsystems (3)
PATCH 1/1 drm: integer overflow in vmw_kms_update_layout_ioctl()
From: Yongjian Xu <[email protected]>
rects is copy_from_user.
rects[i].x and rects[i].y are signed.
rects[i].w and rects[i].h are unsigned.
If rects[i].w is large enough, integer overflow could happen in: rects[i].x + rects[i].w rects[i].h has the same problem.
Reported-by Yongjian xu <[email protected]>
Suggested-by Qixue Xiao <[email protected]>
Signed-off-by Yu Chen <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -0
@@ -2045,6 +2045,8 @@ int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,for (i =0 ; i < arg->num_outputs; ++i) {if (rects[i].x <0 || rects[i].y <0 || + rects[i].w > mode_config->max_width || + rects[i].h > mode_config->max_height || rects[i].x + rects[i].w > mode_config->max_width || rects[i].y + rects[i].h > mode_config->max_height) {DRM_ERROR ("Invalid GUI layout.\n" );
Signature · 1 line
1.7.9.5