CVE-2026-139615

vfio: Reject a second cdev open before mutating shared device state

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

vfio: Reject a second cdev open before mutating shared device state

The cdev single-open check lives in vfio_df_open(), which runs at the
end of the bind ioctl, after vfio_df_ioctl_bind_iommufd() has already
updated state shared across all opens: vfio_df_check_token() can set
the PF vf_token and vfio_df_get_kvm_safe() records the caller's KVM
pointer in device->kvm and takes a reference.

A second cdev bind of an already-open device runs both, only to be
rejected in vfio_df_open(). The error path clears device->kvm and
drops the reference, tearing down the current opener's KVM association
and potentially resulting in an unbalanced reference on close or
premature release, while the vf_token remains clobbered.

Move the single-open check into vfio_df_ioctl_bind_iommufd() ahead of
both mutations, so a bind that cannot complete leaves the current
opener's state untouched. df->group is NULL on this path, so a
non-zero open_count is exactly what vfio_df_open() rejected. The test
in vfio_df_open() becomes redundant and is removed.

Return -EBUSY rather than -EINVAL here. The arguments are not invalid,
the device is in use, which could be a transient condition due to a
delayed fput if the prior user is terminated. This provides
compatibility with the group path, where a group open returns -EBUSY,
and users may choose bounded polling to detect such a transient
condition.

Analysis

AI-generated

Technical impact

The Linux kernel VFIO subsystem contains a flaw where a second character device (cdev) bind attempt on an already open device can clear shared state and drop a reference count, leaving the device’s token and KVM association in an inconsistent state. This unbalanced state manipulation can lead to kernel memory corruption, potentially enabling arbitrary code execution from within the kernel context. The core weakness is an improper use‑after‑free/consistency error in device state handling, classified as CWE‑416.

Affected Systems

All Linux kernel releases that lack the commit fixes referenced in the CVE advisory are affected. The CVE references several kernel commit URLs (e.g., commit 258ba46543..., 52478ef75b..., e5026289a5...), indicating that any kernel prior to those commits is at risk. No specific vendor or version list is provided, but the issue applies broadly to all Linux distributions employing the affected kernel version.

Risk and Exploitability

The risk is high due to kernel‑level exploitation potential, but the vulnerability requires local access to trigger the vulnerable VFIO ioctl sequence. No EPSS data is available, and the issue is not listed in CISA’s KEV catalog, suggesting that exploitation is not yet widely observed. Nonetheless, the high impact and potential for privilege escalation warrant prompt remediation. The attack vector is inferred to be a local, kernel‑interaction scenario involving repeated VFIO bind/ioctl operations that trigger the unbalanced state cleanup.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that includes the VFIO single‑open check fix as described in the referenced commits.
  • After upgrading, reboot the system to load the patched kernel from memory.
  • Observe system logs for EBUSY errors or kernel warnings that may indicate lingering resource‑state issues.

Generated by OpenCVE AI on December 1, 2026 at 00:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: vfio: Reject a second cdev open before mutating shared device state The cdev single-open check lives in vfio_df_open(), which runs at the end of the bind ioctl, after vfio_df_ioctl_bind_iommufd() has already updated state shared across all opens: vfio_df_check_token() can set the PF vf_token and vfio_df_get_kvm_safe() records the caller's KVM pointer in device->kvm and takes a reference. A second cdev bind of an already-open device runs both, only to be rejected in vfio_df_open(). The error path clears device->kvm and drops the reference, tearing down the current opener's KVM association and potentially resulting in an unbalanced reference on close or premature release, while the vf_token remains clobbered. Move the single-open check into vfio_df_ioctl_bind_iommufd() ahead of both mutations, so a bind that cannot complete leaves the current opener's state untouched. df->group is NULL on this path, so a non-zero open_count is exactly what vfio_df_open() rejected. The test in vfio_df_open() becomes redundant and is removed. Return -EBUSY rather than -EINVAL here. The arguments are not invalid, the device is in use, which could be a transient condition due to a delayed fput if the prior user is terminated. This provides compatibility with the group path, where a group open returns -EBUSY, and users may choose bounded polling to detect such a transient condition.
Title vfio: Reject a second cdev open before mutating shared device state
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:36 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM