be32b4bab6
[ Upstream commit b7e99058eb2e86aabd7a10761e76cae33d22b49f ] Fixes index out of bounds issue in `cm_helper_translate_curve_to_degamma_hw_format` function. The issue could occur when the index 'i' exceeds the number of transfer function points (TRANSFER_FUNC_POINTS). The fix adds a check to ensure 'i' is within bounds before accessing the transfer function points. If 'i' is out of bounds the function returns false to indicate an error. Reported by smatch: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:594 cm_helper_translate_curve_to_degamma_hw_format() error: buffer overflow 'output_tf->tf_pts.red' 1025 <= s32max drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:595 cm_helper_translate_curve_to_degamma_hw_format() error: buffer overflow 'output_tf->tf_pts.green' 1025 <= s32max drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:596 cm_helper_translate_curve_to_degamma_hw_format() error: buffer overflow 'output_tf->tf_pts.blue' 1025 <= s32max Cc: Tom Chung <chiahsuan.chung@amd.com> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Cc: Roman Li <roman.li@amd.com> Cc: Alex Hung <alex.hung@amd.com> Cc: Aurabindo Pillai <aurabindo.pillai@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org> |
||
---|---|---|
.. | ||
dcn10_cm_common.c | ||
dcn10_cm_common.h | ||
dcn10_dpp.c | ||
dcn10_dpp.h | ||
dcn10_dpp_cm.c | ||
dcn10_dpp_dscl.c | ||
dcn10_dwb.c | ||
dcn10_dwb.h | ||
dcn10_hubbub.c | ||
dcn10_hubbub.h | ||
dcn10_hubp.c | ||
dcn10_hubp.h | ||
dcn10_hw_sequencer.c | ||
dcn10_hw_sequencer.h | ||
dcn10_hw_sequencer_debug.c | ||
dcn10_hw_sequencer_debug.h | ||
dcn10_init.c | ||
dcn10_init.h | ||
dcn10_ipp.c | ||
dcn10_ipp.h | ||
dcn10_link_encoder.c | ||
dcn10_link_encoder.h | ||
dcn10_mpc.c | ||
dcn10_mpc.h | ||
dcn10_opp.c | ||
dcn10_opp.h | ||
dcn10_optc.c | ||
dcn10_optc.h | ||
dcn10_resource.c | ||
dcn10_resource.h | ||
dcn10_stream_encoder.c | ||
dcn10_stream_encoder.h | ||
Makefile |