CVE-2026-139615: vfio: Reject a second cdev open before mutating shared device state
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 vfiodfopen(), which runs at the end of the bind ioctl, after vfiodfioctlbindiommufd() has already updated state shared across all opens: vfiodfchecktoken() can set the PF vftoken and vfiodfgetkvmsafe() 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 vfiodfopen(). 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 vftoken remains clobbered.
Move the single-open check into vfiodfioctlbindiommufd() 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 opencount is exactly what vfiodfopen() rejected. The test in vfiodfopen() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using the Linux kernel VFIO cdev interface are exposed when a device that is already open receives a second bind attempt. The issue concerns shared device state used across opens, including the KVM association and VF token.
What does an attacker or triggering process need to do?
A process must attempt to bind an already-open VFIO cdev device. Before the fix, that second bind could modify shared state before the single-open restriction rejected it.
How can I tell whether a second bind is being rejected by the corrected behavior?
The corrected path rejects a bind for an in-use device with -EBUSY. This check occurs before the bind operation changes the existing opener's shared device state.
What is the practical impact of an unsuccessful second bind before the fix?
The failed bind can clear the current opener's KVM association and drop its reference, potentially causing an unbalanced reference on close or premature release. It can also overwrite the PF VF token.