]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu/df: fix potential array out-of-bounds read
authorColin Ian King <colin.king@canonical.com>
Wed, 30 May 2018 16:41:44 +0000 (17:41 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 1 Jun 2018 14:45:05 +0000 (09:45 -0500)
commit9fdd8d6faf286313e2ef4fc322d7983262b6b060
tree28d73323c6b2e426253b7b26a5d6702e669ddc8e
parent0e08d4957152931a0d214aa452d82c7c4681df74
drm/amdgpu/df: fix potential array out-of-bounds read

The comparison with the number of elements in array df_v3_7_channel_number
is off-by-one and can produce an array out-of-bounds read if
fb_channel_number is equal to the number of elements of the array. Fix
this by changing the comparison to >= instead of >.

Detected by CoverityScan, CID#1469489 ("Out-of-bounds read")

Fixes: 4b6c67f8ed57 ("drm/amdgpu/df: implement df v3_6 callback functions (v2)")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/df_v3_6.c