kernel_samsung_a53x/drivers/gpu/drm/amd/display/dc/dcn10
Srinivasan Shanmugam be32b4bab6 drm/amd/display: Fix index out of bounds in degamma hardware format translation
[ 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>
2024-11-23 23:21:41 +01:00
..
dcn10_cm_common.c drm/amd/display: Fix index out of bounds in degamma hardware format translation 2024-11-23 23:21:41 +01:00
dcn10_cm_common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_dpp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_dpp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_dpp_cm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_dpp_dscl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_dwb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_dwb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hubbub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hubbub.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hubp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hubp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hw_sequencer.c drm/amd/display: Fix potential NULL pointer dereferences in 'dcn10_set_output_transfer_func()' 2024-11-19 08:44:51 +01:00
dcn10_hw_sequencer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hw_sequencer_debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_hw_sequencer_debug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_init.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_init.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_ipp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_ipp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_link_encoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_link_encoder.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_mpc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_mpc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_opp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_opp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_optc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_optc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_resource.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_resource.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10_stream_encoder.c drm/amd/display: Handle Y carry-over in VCP X.Y calculation 2024-11-19 14:19:01 +01:00
dcn10_stream_encoder.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00