0498-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch 1013 B

123456789101112131415161718192021222324252627
  1. From b5dd047d429d99a2e9a567d29df581e21e7ba071 Mon Sep 17 00:00:00 2001
  2. From: popcornmix <popcornmix@gmail.com>
  3. Date: Wed, 7 Sep 2016 16:57:59 +0100
  4. Subject: [PATCH] fbmem: Ensure that parameters are properly checked within
  5. fb_copyarea_user
  6. ---
  7. drivers/video/fbdev/core/fbmem.c | 8 +++++++-
  8. 1 file changed, 7 insertions(+), 1 deletion(-)
  9. --- a/drivers/video/fbdev/core/fbmem.c
  10. +++ b/drivers/video/fbdev/core/fbmem.c
  11. @@ -1097,7 +1097,13 @@ static int fb_copyarea_user(struct fb_in
  12. int ret = 0;
  13. if (!lock_fb_info(info))
  14. return -ENODEV;
  15. - if (copy->dx + copy->width > info->var.xres ||
  16. + if (copy->dx >= info->var.xres ||
  17. + copy->sx >= info->var.xres ||
  18. + copy->width > info->var.xres ||
  19. + copy->dy >= info->var.yres ||
  20. + copy->sy >= info->var.yres ||
  21. + copy->height > info->var.yres ||
  22. + copy->dx + copy->width > info->var.xres ||
  23. copy->sx + copy->width > info->var.xres ||
  24. copy->dy + copy->height > info->var.yres ||
  25. copy->sy + copy->height > info->var.yres) {