Skip to content

Commit

Permalink
fbmem: Ensure that parameters are properly checked within fb_copyarea…
Browse files Browse the repository at this point in the history
…_user
  • Loading branch information
popcornmix committed Sep 7, 2016
1 parent 5da9be8 commit a9d3875
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/video/fbdev/core/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,13 @@ static int fb_copyarea_user(struct fb_info *info,
int ret = 0;
if (!lock_fb_info(info))
return -ENODEV;
if (copy->dx + copy->width > info->var.xres ||
if (copy->dx >= info->var.xres ||
copy->sx >= info->var.xres ||
copy->width > info->var.xres ||
copy->dy >= info->var.yres ||
copy->sy >= info->var.yres ||
copy->height > info->var.yres ||
copy->dx + copy->width > info->var.xres ||
copy->sx + copy->width > info->var.xres ||
copy->dy + copy->height > info->var.yres ||
copy->sy + copy->height > info->var.yres) {
Expand Down

0 comments on commit a9d3875

Please sign in to comment.