Subject: CVE-2022-48887: drm/vmwgfx: Remove rcu locks from user resources

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

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

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

drm/vmwgfx: Remove rcu locks from user resources

User resource lookups used rcu to avoid two extra atomics. Unfortunately
the rcu paths were buggy and it was easy to make the driver crash by
submitting command buffers from two different threads. Because the
lookups never show up in performance profiles replace them with a
regular spin lock which fixes the races in accesses to those shared
resources.

Fixes kernel oops'es in IGT's vmwgfx execution_buffer stress test and
seen crashes with apps using shared resources.

The Linux kernel CVE team has assigned CVE-2022-48887 to this issue.

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

	Issue introduced in 4.20 with commit e14c02e6b699 and fixed in 6.1.7 with commit 7ac9578e45b2
	Issue introduced in 4.20 with commit e14c02e6b699 and fixed in 6.2 with commit a309c7194e8a

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-2022-48887
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/ttm_object.c
	drivers/gpu/drm/vmwgfx/ttm_object.h
	drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
	drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
	drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
	drivers/gpu/drm/vmwgfx/vmwgfx_resource.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/7ac9578e45b20e3f3c0c8eb71f5417a499a7226a
	https://git.kernel.org/stable/c/a309c7194e8a2f8bd4539b9449917913f6c2cd50