In the Linux kernel, the following vulnerability has been resolved:drm/amd/display: Prevent potential buffer overflow in map_hw_resourcesAdds a check in the map_hw_resources function to prevent a potentialbuffer overflow. The function was accessing arrays using an index thatcould potentially be greater than the size of the arrays, leading to abuffer overflow.Adds a check to ensure that the index is within the bounds of thearrays. If the index is out of bounds, an error message is printed andbreak it will continue execution with just ignoring extra data early toprevent the buffer overflow.Reported by smatch:drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c:79 map_hw_resources() error: buffer overflow 'dml2->v20.scratch.dml_to_dc_pipe_mapping.disp_cfg_to_stream_id' 6 <= 7drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_wrapper.c:81 map_hw_resources() error: buffer overflow 'dml2->v20.scratch.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id' 6 <= 7
CWE-120 Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')