diff options
| author | Srinivasan Shanmugam <[email protected]> | 2024-01-29 15:47:09 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-01-31 19:05:19 +0000 |
| commit | e3854253a5f695f06b51b773b4056b564f43aeaa (patch) | |
| tree | b46e89284d7af9a0b9f9efdf69b59eff50ba605a /drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | |
| parent | drm/amd/display: Add NULL check for kzalloc in 'amdgpu_dm_atomic_commit_tail()' (diff) | |
| download | kernel-e3854253a5f695f06b51b773b4056b564f43aeaa.tar.gz kernel-e3854253a5f695f06b51b773b4056b564f43aeaa.zip | |
drm/amd/display: Fix buffer overflow in 'get_host_router_total_dp_tunnel_bw()'
The error message buffer overflow 'dc->links' 12 <= 12 suggests that the
code is trying to access an element of the dc->links array that is
beyond its bounds. In C, arrays are zero-indexed, so an array with 12
elements has valid indices from 0 to 11. Trying to access dc->links[12]
would be an attempt to access the 13th element of a 12-element array,
which is a buffer overflow.
To fix this, ensure that the loop does not go beyond the last valid
index when accessing dc->links[i + 1] by subtracting 1 from the loop
condition.
This would ensure that i + 1 is always a valid index in the array.
Fixes the below:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_dpia_bw.c:208 get_host_router_total_dp_tunnel_bw() error: buffer overflow 'dc->links' 12 <= 12
Fixes: 59f1622a5f05 ("drm/amd/display: Add dpia display mode validation logic")
Cc: PeiChen Huang <[email protected]>
Cc: Aric Cyr <[email protected]>
Cc: Rodrigo Siqueira <[email protected]>
Cc: Aurabindo Pillai <[email protected]>
Cc: Meenakshikumar Somasundaram <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Tom Chung <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c')
0 files changed, 0 insertions, 0 deletions
