exynos-linux-stable/drivers/gpu/drm/msm
Dan Carpenter 8b2653de6f drm/msm: fix an integer overflow test
commit 65e93108891e571f177c202add9288eda9ac4100 upstream.

We recently added an integer overflow check but it needs an additional
tweak to work properly on 32 bit systems.

The problem is that we're doing the right hand side of the assignment as
type unsigned long so the max it will have an integer overflow instead
of being larger than SIZE_MAX.  That means the "sz > SIZE_MAX" condition
is never true even on 32 bit systems.  We need to first cast it to u64
and then do the math.

Fixes: 4a630fadbb29 ("drm/msm: Fix potential buffer overflow issue")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-08 10:08:32 +01:00
..
adreno drm/msm: Ensure that the hardware write pointer is valid 2017-08-06 18:59:45 -07:00
dsi drm/msm: Set CLK_IGNORE_UNUSED flag for PLL clocks 2016-11-02 10:48:09 -04:00
edp drm: msm: Rely on the default ->best_encoder() behavior where appropriate 2016-06-09 08:43:26 +02:00
hdmi drm/msm: Set CLK_IGNORE_UNUSED flag for PLL clocks 2016-11-02 10:48:09 -04:00
mdp drm/msm/mdp5: 8x16 actually has 8 mixer stages 2016-11-02 10:50:10 -04:00
Kconfig drm/msm: submit support for in-fences 2016-09-15 17:39:49 -04:00
Makefile drm/msm: shrinker support 2016-07-16 10:09:06 -04:00
msm_atomic.c drm/fence: allow fence waiting to be interrupted by userspace 2016-09-12 16:59:15 -04:00
msm_debugfs.c drm/msm: move debugfs code to it's own file 2016-05-08 10:16:02 -04:00
msm_debugfs.h drm/msm: move debugfs code to it's own file 2016-05-08 10:16:02 -04:00
msm_drv.c drm/msm: Expose our reservation object when exporting a dmabuf. 2017-06-14 15:06:00 +02:00
msm_drv.h drm/msm: Expose our reservation object when exporting a dmabuf. 2017-06-14 15:06:00 +02:00
msm_fb.c drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() 2016-07-16 10:29:34 -04:00
msm_fbdev.c drm/msm: change gem->vmap() to get/put 2016-07-16 10:09:07 -04:00
msm_fence.c drm/msm: 'struct fence' conversion 2016-05-08 10:22:15 -04:00
msm_fence.h drm/msm: 'struct fence' conversion 2016-05-08 10:22:15 -04:00
msm_gem.c Linux 4.8-rc8 2016-09-28 12:08:49 +10:00
msm_gem.h drm/msm: deal with arbitrary # of cmd buffers 2016-07-16 10:09:08 -04:00
msm_gem_prime.c drm/msm: Expose our reservation object when exporting a dmabuf. 2017-06-14 15:06:00 +02:00
msm_gem_shrinker.c drm/msm: Fix error handling crashes seen when VRAM allocation fails 2016-11-04 11:51:37 -04:00
msm_gem_submit.c drm/msm: fix an integer overflow test 2017-11-08 10:08:32 +01:00
msm_gpu.c drm/msm: move fence allocation out of msm_gpu_submit() 2016-09-15 17:43:51 -04:00
msm_gpu.h drm/msm: move fence allocation out of msm_gpu_submit() 2016-09-15 17:43:51 -04:00
msm_iommu.c drm/msm: Print the correct virtual addresses in map/unmap funcs 2016-07-16 10:08:44 -04:00
msm_kms.h drm/msm/mdp5: Remove old kms init/destroy funcs 2016-07-16 10:08:57 -04:00
msm_mmu.h drm/msm: make iommu port names const'ier 2016-03-02 16:19:43 -05:00
msm_perf.c gpu: use %pd 2016-08-07 23:38:48 -04:00
msm_rd.c gpu: use %pd 2016-08-07 23:38:48 -04:00
msm_ringbuffer.c drm/msm: Ensure that the hardware write pointer is valid 2017-08-06 18:59:45 -07:00
msm_ringbuffer.h drm/msm: add a3xx gpu support 2013-08-24 14:57:18 -04:00
NOTES drm/msm: add mdp5/apq8x74 2014-01-09 14:44:06 -05:00