Subject: CVE-2023-52822: drm: vmwgfx_surface.c: copy user-array safely

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

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

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

drm: vmwgfx_surface.c: copy user-array safely

Currently, there is no overflow-check with memdup_user().

Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.

The Linux kernel CVE team has assigned CVE-2023-52822 to this issue.

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

	Fixed in 5.15.140 with commit 689b33b94f09
	Fixed in 6.1.64 with commit 412ce8966934
	Fixed in 6.5.13 with commit 1eacb4c96e73
	Fixed in 6.6.3 with commit 21e29f1437b7
	Fixed in 6.7 with commit 06ab64a0d836

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-2023-52822
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/vmwgfx/vmwgfx_surface.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/689b33b94f096e717cd8f140a8b5502e7e4fe759
	https://git.kernel.org/stable/c/412ce89669341dfd8ed98a4746ad3dbe9653a7b8
	https://git.kernel.org/stable/c/1eacb4c96e73225a2f6f276bade006abbe4d8341
	https://git.kernel.org/stable/c/21e29f1437b7c36c76efa908589578eaf0f50900
	https://git.kernel.org/stable/c/06ab64a0d836ac430c5f94669710a78aa43942cb