linux/drivers/gpu/drm
Srinivasan Shanmugam 63ae548f10 drm/amd/display: Fix potential index out of bounds in color transformation function
Fixes index out of bounds issue in the color transformation 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, an error message is
logged and the function returns false to indicate an error.

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:405 cm_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.red' 1025 <= s32max
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:406 cm_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.green' 1025 <= s32max
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:407 cm_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.blue' 1025 <= s32max

Fixes: b629596072 ("drm/amd/display: Build unity lut for shaper")
Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Cc: Charlene Liu <Charlene.Liu@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Tom Chung <chiahsuan.chung@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>
2024-03-20 13:37:37 -04:00
..
amd drm/amd/display: Fix potential index out of bounds in color transformation function 2024-03-20 13:37:37 -04:00
arm
armada
aspeed
ast This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
atmel-hlcdc
bridge drm/bridge: adv7511: fix crash on irq during probe 2024-02-21 16:29:58 +01:00
ci drm/ci: mark universal-plane-sanity as failing on SC7180 2024-02-19 17:31:18 -03:00
display drm-misc-next for v6.9: 2024-03-01 15:27:50 +10:00
etnaviv - various code cleanups 2024-03-08 12:36:55 +10:00
exynos Several fixups 2024-01-25 14:22:15 +10:00
fsl-dcu
gma500 drm: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
gud
hisilicon drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
hyperv drm/hyperv: Remove firmware framebuffers with aperture helper 2024-01-12 12:38:37 +01:00
i2c
i915 Merge drm/drm-next into drm-misc-next-fixes 2024-03-07 13:30:43 +01:00
imagination One fix for drm/plane to avoid a use-after-free and some additional 2024-01-05 10:31:54 +10:00
imx drm/imx/dcss: fix resource size calculation 2024-02-28 09:16:59 +00:00
ingenic drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
kmb
lib
lima drm/lima: standardize debug messages by ip name 2024-02-12 16:27:48 +08:00
logicvc
loongson Merge drm/drm-next into drm-misc-next 2024-01-29 14:20:23 +01:00
mcde drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
mediatek Mediatek DRM Next for Linux 6.9 2024-03-01 19:14:33 +10:00
meson Linux 6.8-rc6 2024-02-26 11:41:07 +01:00
mgag200 drm/mgag200: Add a workaround for low-latency 2024-02-26 16:37:51 +01:00
msm drm/msm/dpu: capture snapshot on the first commit_done timeout 2024-03-04 11:44:03 +02:00
mxsfb drm: lcdif: Switch to drmm_mode_config_init 2024-02-26 08:33:45 +01:00
nouveau drm/nouveau: Include <linux/backlight.h> 2024-02-28 09:59:26 +01:00
omapdrm drm/omap/hdmi5: switch to ->edid_read callback 2024-02-09 10:16:01 +02:00
panel drm/dp: Don't attempt AUX transfers when eDP panels are not powered 2024-02-28 12:43:36 -08:00
panfrost
pl111 drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
qxl drm/ttm: replace busy placement with flags v6 2024-01-25 09:59:44 +01:00
radeon amd-drm-next-6.9-2024-03-01: 2024-03-08 11:21:13 +10:00
renesas drm: renesas: rz-du: Fix redefinition errors related to rzg2l_du_vsp_*() 2024-02-22 14:46:41 +01:00
rockchip Linux 6.8-rc6 2024-02-26 11:41:07 +01:00
scheduler drm/scheduler: Simplify the allocation of slab caches in drm_sched_fence_slab_init 2024-02-28 15:55:13 +01:00
solomon drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
sprd
sti
stm
sun4i drm/sun4i: hdmi: Add missing drm_atomic header 2024-03-01 19:10:29 +10:00
tegra drm/tegra: put drm_gem_object ref on error in tegra_fb_create 2024-02-22 18:29:22 +01:00
tests drm/tests: connector: Add tests for drmm_connector_init 2024-02-28 16:38:33 +01:00
tidss drm/tidss: Fix sync-lost issue with two displays 2024-02-26 10:09:43 +02:00
tilcdc drm/tilcdc: request and mapp iomem with devres 2023-12-28 19:29:04 +02:00
tiny
ttm Linux 6.8-rc6 2024-02-26 11:41:07 +01:00
tve200 drm: Clean-up superfluously selecting VT_HW_CONSOLE_BINDING 2024-01-12 13:58:20 +01:00
udl
v3d drm/v3d: Enable V3D to use different PAGE_SIZE 2024-02-23 16:37:20 -03:00
vboxvideo
vc4 drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
vgem
virtio drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
vkms drm/vkms: Avoid reading beyond LUT array 2024-01-02 12:06:53 -01:00
vmwgfx drm/vmwgfx: Fix the lifetime of the bo cursor memory 2024-01-30 14:18:21 -05:00
xe drm/xe: Replace 'grouped target' in Makefile with pattern rule 2024-03-04 08:41:28 -06:00
xen
xlnx drm: xlnx: zynqmp_dpsub: switch to ->edid_read callback 2024-02-09 10:16:03 +02:00
drm_aperture.c
drm_atomic.c
drm_atomic_helper.c
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_auth.c drm-next for 6.8: 2024-01-12 11:32:19 -08:00
drm_blend.c
drm_bridge.c drm/bridge: remove ->get_edid callback 2024-02-09 10:16:20 +02:00
drm_bridge_connector.c drm/bridge: switch to drm_bridge_edid_read() 2024-02-08 17:10:44 +02:00
drm_buddy.c drm/buddy: Modify duplicate list_splice_tail call 2024-02-16 13:03:14 +01:00
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c
drm_connector.c
drm_crtc.c drm: Remove drm_num_crtcs() helper 2024-02-28 12:18:07 +01:00
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c drm/debugfs: drop unneeded DEBUG_FS guard 2024-01-02 15:50:13 +02:00
drm_debugfs_crc.c
drm_displayid.c
drm_drv.c
drm_dumb_buffers.c
drm_edid.c drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
drm_edid_load.c drm/edid/firmware: Remove built-in EDIDs 2024-02-26 14:05:18 +01:00
drm_eld.c
drm_encoder.c
drm_encoder_slave.c
drm_exec.c Merge drm/drm-next into drm-misc-next 2024-01-29 14:20:23 +01:00
drm_fb_dma_helper.c
drm_fb_helper.c
drm_fbdev_dma.c
drm_fbdev_generic.c
drm_file.c drm: update drm_show_memory_stats() for dma-bufs 2024-02-16 12:52:50 +01:00
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c drm: Warn when freeing a framebuffer that's still on a list 2023-12-23 07:31:29 +02:00
drm_gem.c
drm_gem_atomic_helper.c
drm_gem_dma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm/ttm: replace busy placement with flags v6 2024-01-25 09:59:44 +01:00
drm_gpuvm.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_kms_helper_common.c
drm_lease.c
drm_managed.c drm/managed: Add drmm_release_action 2024-01-17 10:38:39 +01:00
drm_mipi_dbi.c
drm_mipi_dsi.c drm: mipi-dsi: make mipi_dsi_bus_type const 2024-02-07 12:35:10 +02:00
drm_mm.c
drm_mode_config.c drm/mode: switch from drm_debug_printer() to device specific drm_dbg_printer() 2024-02-09 11:51:59 +02:00
drm_mode_object.c
drm_modes.c drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
drm_modeset_helper.c drm: Check output polling initialized before disabling 2024-02-28 15:07:15 +01:00
drm_modeset_lock.c drm: remove drm_debug_printer in favor of drm_dbg_printer 2024-02-09 11:52:43 +02:00
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c drm: panel-orientation-quirks: Add quirk for GPD Win Mini 2024-01-19 09:25:22 +01:00
drm_pci.c
drm_plane.c drm: Don't unref the same fb many times by mistake due to deadlock handling 2023-12-23 07:31:05 +02:00
drm_plane_helper.c
drm_prime.c drm/prime: Support page array >= 4GB 2024-02-13 16:36:04 +01:00
drm_print.c drm: remove drm_debug_printer in favor of drm_dbg_printer 2024-02-09 11:52:43 +02:00
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes 2024-02-28 15:07:22 +01:00
drm_property.c
drm_rect.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_suballoc.c
drm_syncobj.c Linux 6.8-rc6 2024-02-26 11:41:07 +01:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vma_manager.c
drm_writeback.c
Kconfig drm-misc-next for v6.9: 2024-02-05 13:50:15 +10:00
Makefile