Subject: CVE-2024-36944: Reapply "drm/qxl: simplify qxl_fence_wait"

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

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

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

Reapply "drm/qxl: simplify qxl_fence_wait"

This reverts commit 07ed11afb68d94eadd4ffc082b97c2331307c5ea.

Stephen Rostedt reports:
 "I went to run my tests on my VMs and the tests hung on boot up.
  Unfortunately, the most I ever got out was:

  [   93.607888] Testing event system initcall: OK
  [   93.667730] Running tests on all trace events:
  [   93.669757] Testing all events: OK
  [   95.631064] ------------[ cut here ]------------
  Timed out after 60 seconds"

and further debugging points to a possible circular locking dependency
between the console_owner locking and the worker pool locking.

Reverting the commit allows Steve's VM to boot to completion again.

[ This may obviously result in the "[TTM] Buffer eviction failed"
  messages again, which was the reason for that original revert. But at
  this point this seems preferable to a non-booting system... ]

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

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

	Fixed in 5.15.159 with commit 4a89ac4b0921
	Fixed in 6.1.91 with commit b548c53bc3ab
	Fixed in 6.6.31 with commit 148ed8b4d64f
	Fixed in 6.8.10 with commit 3dfe35d8683d
	Fixed in 6.9 with commit 3628e0383dd3

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-36944
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/qxl/qxl_release.c
	include/linux/dma-fence.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/4a89ac4b0921c4ea21eb1b4cf3a469a91bacfcea
	https://git.kernel.org/stable/c/b548c53bc3ab83dc6fc86c8e840f013b2032267a
	https://git.kernel.org/stable/c/148ed8b4d64f94ab079c8f0d88c3f444db97ba97
	https://git.kernel.org/stable/c/3dfe35d8683daf9ba69278643efbabe40000bbf6
	https://git.kernel.org/stable/c/3628e0383dd349f02f882e612ab6184e4bb3dc10