Subject: CVE-2024-50016: drm/amd/display: Avoid overflow assignment in link_dp_cts

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

drm/amd/display: Avoid overflow assignment in link_dp_cts

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.

The Linux kernel CVE team has assigned CVE-2024-50016 to this issue.

Affected and fixed versions
===========================

	Fixed in 6.6.55 with commit a1495acc6234
	Fixed in 6.10.14 with commit 26ced9d86240
	Fixed in 6.11.3 with commit adeed800bc30
	Fixed in 6.12-rc1 with commit a15268787b79

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2024-50016
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/gpu/drm/amd/display/dc/dc_dp_types.h
	drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c
	drivers/gpu/drm/amd/display/include/dpcd_defs.h

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/a1495acc6234fa79b775599d3f49009afd53299f
	https://git.kernel.org/stable/c/26ced9d86240868f5b41708ceee02e6ec2924498
	https://git.kernel.org/stable/c/adeed800bc30ef718478b28c08f79231e5980e3d
	https://git.kernel.org/stable/c/a15268787b79fd183dd526cc16bec9af4f4e49a1