]> git.baikalelectronics.ru Git - kernel.git/commit
drm/atomic: fix out of bounds read in for_each_*_in_state helpers
authorAndrey Ryabinin <a.ryabinin@samsung.com>
Mon, 25 May 2015 10:29:44 +0000 (13:29 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 26 May 2015 15:31:52 +0000 (17:31 +0200)
commit1ea8e6877c49d44ae4f13701ed79a5985bcd77c9
tree222c8cbf96f442329c2dc37ae7a986bc5e7e4c12
parent5b49d9cd8cd791f1bbf7348a116d5399bbccf1bc
drm/atomic: fix out of bounds read in for_each_*_in_state helpers

for_each_*_in_state validate array index after
access to array elements, thus perform out of bounds read.

Fix this by validating index in the first place and read
array element iff validation was successful.

Fixes: e231361f2d1c ("drm/atomic: Add for_each_{connector,crtc,plane}_in_state helper macros")
Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
include/drm/drm_atomic.h