Loading
drm/amd/display: Avoid overflow assignment in link_dp_cts
mainline inclusion from mainline-v6.12-rc1 commit a15268787b79fd183dd526cc16bec9af4f4e49a1 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYRBP CVE: CVE-2024-50016 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a15268787b79fd183dd526cc16bec9af4f4e49a1 -------------------------------- [ Upstream commit a15268787b79fd183dd526cc16bec9af4f4e49a1 ] sampling_rate is an uint8_t but is assigned an unsigned int, and thus it can overflow. As a result, sampling_rate is changed to uint32_t. Similarly, LINK_QUAL_PATTERN_SET has a size of 2 bits, and it should only be assigned to a value less or equal than 4. This fixes 2 INTEGER_OVERFLOW issues reported by Coverity. Signed-off-by:Alex Hung <alex.hung@amd.com> Reviewed-by:
Wenjing Liu <wenjing.liu@amd.com> Tested-by:
Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by:
Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Conflicts: drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c [file changed] Signed-off-by:
Yuntao Liu <liuyuntao12@huawei.com>