Subject: CVE-2024-40926: drm/nouveau: don't attempt to schedule hpd_work on headless cards

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

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

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

drm/nouveau: don't attempt to schedule hpd_work on headless cards

If the card doesn't have display hardware, hpd_work and hpd_lock are
left uninitialized which causes BUG when attempting to schedule hpd_work
on runtime PM resume.

Fix it by adding headless flag to DRM and skip any hpd if it's set.

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

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

	Issue introduced in 6.7 with commit ae1aadb1eb8d and fixed in 6.9.6 with commit 227349998e57
	Issue introduced in 6.7 with commit ae1aadb1eb8d and fixed in 6.10 with commit b96a225377b6

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-40926
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/dispnv04/disp.c
	drivers/gpu/drm/nouveau/dispnv50/disp.c
	drivers/gpu/drm/nouveau/nouveau_display.c
	drivers/gpu/drm/nouveau/nouveau_drv.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/227349998e5740f14d531b0f0d704e66b1ed3c2f
	https://git.kernel.org/stable/c/b96a225377b6602299a03d2ce3c289b68cd41bb7