kernel_samsung_a53x/drivers/gpu/drm/amd/display/dc
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
..
basics Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bios Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
calcs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clk_mgr drm/amd/display: Check num_valid_sets before accessing reader_wm_sets[] 2024-11-23 23:20:57 +01:00
core drm/amd/display: Check stream before comparing them 2024-11-23 23:21:40 +01:00
dce Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce60 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce80 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce100 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce110 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce112 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce120 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn10 drm/amd/display: Fix index out of bounds in degamma hardware format translation 2024-11-23 23:21:41 +01:00
dcn20 drm/amd/display: Skip wbscl_set_scaler_filter if filter is null 2024-11-23 23:20:58 +01:00
dcn21 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcn30 drm/amd/display: Fix index out of bounds in DCN30 degamma hardware format translation 2024-11-23 23:21:41 +01:00
dml Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpio drm/amd/display: Fix Coverity INTEGER_OVERFLOW within dal_gpio_service_create 2024-11-23 23:20:57 +01:00
hdcp drm/amd/display: Check msg_id before processing transcation 2024-11-23 23:20:57 +01:00
inc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq drm/amd/display: Check pipe offset before setting vblank 2024-11-19 14:19:40 +01:00
virtual Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_bios_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_ddc_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_dmub_srv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_dmub_srv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_dp_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_dsc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_helper.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_hw_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_link.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_stream.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dc_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm_cp_psp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm_event_log.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm_helpers.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm_pp_smu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm_services.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm_services_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
os_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00