CVE-2025-40117 misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl()

High 7.8 Published Updated

A local attacker can trigger an array underflow in the PCI endpoint test driver via a negative index, potentially leading to code execution or privilege escalation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-40117?

CVE-2025-40117 is a high-severity vulnerability in Linux, published on 12 Nov 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl()

Commit eefb83790a0d ("misc: pci_endpoint_test: Add doorbell test case") added NO_BAR (-1) to the pci_barno enum which, in practical terms, changes the enum from an unsigned int to a signed int. If the user passes a negative number in pci_endpoint_test_ioctl() then it results in an array underflow in pci_endpoint_test_bar().

Which versions are affected by CVE-2025-40117?

How do I fix CVE-2025-40117?

Apply the vendor's patch.

Is CVE-2025-40117 being exploited?

There is no known exploitation of CVE-2025-40117 in the wild and no public exploit code.

Sources

Also known as BELL-CVE-2025-40117, GHSA-5623-gpcg-4jj7, UBUNTU-CVE-2025-40117.

Is CVE-2025-40117 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free