kernel_samsung_a53x/drivers/gpu/drm/amd/display/dc/dcn30
Srinivasan Shanmugam 4b8ffbb768 drm/amd/display: Fix index out of bounds in DCN30 color transformation
[ Upstream commit d81873f9e715b72d4f8d391c8eb243946f784dfc ]

This commit addresses a potential index out of bounds issue in the
`cm3_helper_translate_curve_to_hw_format` function in the DCN30 color
management module. 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.

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_cm_common.c:180 cm3_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.red' 1025 <= s32max
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_cm_common.c:181 cm3_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.green' 1025 <= s32max
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_cm_common.c:182 cm3_helper_translate_curve_to_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
..
dcn30_afmt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_afmt.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_cm_common.c drm/amd/display: Fix index out of bounds in DCN30 color transformation 2024-11-23 23:21:41 +01:00
dcn30_cm_common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dccg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dccg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dio_link_encoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dio_link_encoder.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dio_stream_encoder.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dio_stream_encoder.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dpp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dpp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dpp_cm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dwb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dwb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_dwb_cm.c Revert "drm/amd/display: Validate hw_points_num before using it" 2024-11-23 23:20:50 +01:00
dcn30_hubbub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_hubbub.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_hubp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_hubp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_hwseq.c drm/amd/display: Fix noise issue on HDMI AV mute 2024-11-19 09:22:37 +01:00
dcn30_hwseq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_init.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_init.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_mmhubbub.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_mmhubbub.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_mpc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_mpc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_opp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_optc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_optc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_resource.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_resource.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_vpg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30_vpg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00