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> |
||
---|---|---|
.. | ||
basics | ||
bios | ||
calcs | ||
clk_mgr | ||
core | ||
dce | ||
dce60 | ||
dce80 | ||
dce100 | ||
dce110 | ||
dce112 | ||
dce120 | ||
dcn10 | ||
dcn20 | ||
dcn21 | ||
dcn30 | ||
dml | ||
dsc | ||
gpio | ||
hdcp | ||
inc | ||
irq | ||
virtual | ||
dc.h | ||
dc_bios_types.h | ||
dc_ddc_types.h | ||
dc_dmub_srv.c | ||
dc_dmub_srv.h | ||
dc_dp_types.h | ||
dc_dsc.h | ||
dc_helper.c | ||
dc_hw_types.h | ||
dc_link.h | ||
dc_stream.h | ||
dc_types.h | ||
dm_cp_psp.h | ||
dm_event_log.h | ||
dm_helpers.h | ||
dm_pp_smu.h | ||
dm_services.h | ||
dm_services_types.h | ||
irq_types.h | ||
Makefile | ||
os_types.h |