Subject: CVE-2024-35950: drm/client: Fully protect modes[] with dev->mode_config.mutex

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

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

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

drm/client: Fully protect modes[] with dev->mode_config.mutex

The modes[] array contains pointers to modes on the connectors'
mode lists, which are protected by dev->mode_config.mutex.
Thus we need to extend modes[] the same protection or by the
time we use it the elements may already be pointing to
freed/reused memory.

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

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

	Fixed in 5.4.275 with commit 5a2f957e3c45
	Fixed in 5.10.216 with commit 41586487769e
	Fixed in 5.15.156 with commit d2dc6600d4e3
	Fixed in 6.1.87 with commit 18c8cc6680ce
	Fixed in 6.6.28 with commit 04e018bd913d
	Fixed in 6.8.7 with commit 8ceb873d8167
	Fixed in 6.9 with commit 3eadd887dbac

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-35950
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/drm_client_modeset.c

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/5a2f957e3c4553bbb100504a1acfeaeb33f4ca4e
	https://git.kernel.org/stable/c/41586487769eede64ab1aa6c65c74cbf76c12ef0
	https://git.kernel.org/stable/c/d2dc6600d4e3e1453e3b1fb233e9f97e2a1ae949
	https://git.kernel.org/stable/c/18c8cc6680ce938d0458859b6a08b4d34f7d8055
	https://git.kernel.org/stable/c/04e018bd913d3d3336ab7d21c2ad31a9175fe984
	https://git.kernel.org/stable/c/8ceb873d816786a7c8058f50d903574aff8d3764
	https://git.kernel.org/stable/c/3eadd887dbac1df8f25f701e5d404d1b90fd0fea