CVE-2025-71313: PCI: endpoint: Add missing NULL check for alloc_workqueue()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
PCI: endpoint: Add missing NULL check for alloc_workqueue()
alloc_workqueue() can return NULL on memory allocation failure. Without proper error checking, this may lead to a NULL pointer dereference when queue_work() is later called with the NULL workqueue pointer in epf_ntb_epc_init().
Add a NULL check immediately after alloc_workqueue() and return -ENOMEM on failure to prevent the driver from loading with an invalid workqueue pointer.
The Linux kernel CVE team has assigned CVE-2025-71313 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.12 with commit 8b821cf761503b80d0bd052f932adfe1bc1a0088 and fixed in 6.19.4 with commit 314eab6740bcda504ef978be599f805de05ce6de Issue introduced in 5.12 with commit 8b821cf761503b80d0bd052f932adfe1bc1a0088 and fixed in 7.0 with commit 03f336a869b3a3f119d3ae52ac9723739c7fb7b6
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-2025-71313
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-ntb.c 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/314eab6740bcda504ef978be599f805de05ce6de https://git.kernel.org/stable/c/03f336a869b3a3f119d3ae52ac9723739c7fb7b6