Subject: CVE-2024-43875: PCI: endpoint: Clean up error handling in vpci_scan_bus()

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

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

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

PCI: endpoint: Clean up error handling in vpci_scan_bus()

Smatch complains about inconsistent NULL checking in vpci_scan_bus():

    drivers/pci/endpoint/functions/pci-epf-vntb.c:1024 vpci_scan_bus() error: we previously assumed 'vpci_bus' could be null (see line 1021)

Instead of printing an error message and then crashing we should return
an error code and clean up.

Also the NULL check is reversed so it prints an error for success
instead of failure.

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

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

	Issue introduced in 5.15.153 with commit e2b6ef72b7ae and fixed in 5.15.165 with commit 24414c842a24
	Issue introduced in 6.0 with commit e35f56bb0330 and fixed in 6.1.103 with commit 7d368de78b60
	Issue introduced in 6.0 with commit e35f56bb0330 and fixed in 6.6.44 with commit 0e27e2e8697b
	Issue introduced in 6.0 with commit e35f56bb0330 and fixed in 6.10.3 with commit b9e8695246bc
	Issue introduced in 6.0 with commit e35f56bb0330 and fixed in 6.11 with commit 8e0f5a96c534

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-43875
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/pci/endpoint/functions/pci-epf-vntb.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/24414c842a24d0fd498f9db6d2a762a8dddf1832
	https://git.kernel.org/stable/c/7d368de78b60088ec9031c60c88976c0063ea4c0
	https://git.kernel.org/stable/c/0e27e2e8697b8ce96cdef43f135426525d9d1f8f
	https://git.kernel.org/stable/c/b9e8695246bcfc028341470cbf92630cdc1ba36b
	https://git.kernel.org/stable/c/8e0f5a96c534f781e8c57ca30459448b3bfe5429