Subject: CVE-2024-35786: drm/nouveau: fix stale locked mutex in nouveau_gem_ioctl_pushbuf

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

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

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

drm/nouveau: fix stale locked mutex in nouveau_gem_ioctl_pushbuf

If VM_BIND is enabled on the client the legacy submission ioctl can't be
used, however if a client tries to do so regardless it will return an
error. In this case the clients mutex remained unlocked leading to a
deadlock inside nouveau_drm_postclose or any other nouveau ioctl call.

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

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

	Issue introduced in 6.6 with commit b88baab82871 and fixed in 6.6.24 with commit c288a61a48dd
	Issue introduced in 6.6 with commit b88baab82871 and fixed in 6.7.12 with commit b466416bdd6e
	Issue introduced in 6.6 with commit b88baab82871 and fixed in 6.8 with commit daf8739c3322

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-35786
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/nouveau/nouveau_gem.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/c288a61a48ddb77ec097e11ab81b81027cd4e197
	https://git.kernel.org/stable/c/b466416bdd6ecbde15ce987226ea633a0268fbb1
	https://git.kernel.org/stable/c/daf8739c3322a762ce84f240f50e0c39181a41ab