CVE-2026-89957 Overview
CVE-2026-89957 is a Linux kernel vulnerability in the s390 vfio-ap driver that leaves KVM guests with stale hardware access to unplugged Adjunct Processor (AP) devices. The vfio_ap_mdev_hot_unplug_cfg() function incorrectly uses the return value of bitmap_andnot() to decide whether to update the guest's AP Configuration Block (APCB). When the last adapter, domain, or control domain assigned to a mediated device is removed, bitmap_andnot() returns false because the result bitmap is empty, so the hot-unplug path is skipped. The guest retains cryptographic hardware access that the host has already removed.
Critical Impact
A local, low-privileged actor on an s390 host can trigger a state where KVM guests keep hardware AP device access after removal, breaking isolation between the host AP configuration and guest cryptographic operations.
Affected Products
- Linux kernel s390/vfio-ap driver on IBM Z (s390x) hosts
- KVM guests using mediated AP device passthrough
- Distributions shipping kernels prior to the fixes referenced in the stable tree commits
Discovery Timeline
- 2026-09-16 - CVE-2026-89957 published to the National Vulnerability Database
- 2026-09-16 - Last updated in NVD database
Technical Details for CVE-2026-89957
Vulnerability Analysis
The defect resides in the s390 virtual function I/O AP (vfio-ap) mediated device driver, which brokers cryptographic AP adapter access from the host into KVM guests. During hot-unplug of an AP adapter, usage domain, or control domain, vfio_ap_mdev_hot_unplug_cfg() computes the difference between the shadow APCB and the removal mask using bitmap_andnot(). The function then relies on the bitmap_andnot() return value to set a do_hotplug flag that gates the call to vfio_ap_mdev_update_guest_apcb().
The kernel bitmap_andnot() helper returns false whenever the destination bitmap is empty after the operation. When the removed device is the only one assigned to the mediated device, the shadow APCB legitimately becomes empty, the return value is false, and do_hotplug stays at 0. The guest APCB update never runs, so the guest continues to reference AP hardware resources the host no longer exposes.
Root Cause
The root cause is a semantic misuse of a kernel bitmap helper [CWE-754: Improper Check for Unusual or Exceptional Conditions]. The code conflates "the result bitmap is non-empty" with "a change occurred," but these are distinct conditions. Clearing the last set bit is a real state change that must propagate to the guest.
Attack Vector
Exploitation requires local access on the s390 host with privileges to modify AP mediated device assignments or the host AP configuration. An operator or privileged workload that removes the last AP adapter, usage domain, or control domain from an mdev puts the KVM guest into an inconsistent state. The guest keeps issuing AP instructions against resources the host considers unassigned, which can produce unexpected cryptographic behavior, information exposure across tenant boundaries, or integrity and availability impacts on collocated guests.
No synthetic exploit code is provided. The upstream fix replaces the bitmap_andnot() return-value check with bitmap_intersects() to detect overlap between the shadow APCB and the removal mask, then calls bitmap_andnot() solely for its clearing side effect and unconditionally sets do_hotplug. See the stable tree commits, including commit 04b35dd88c10 and commit 3a9b049bbdc4, for the exact patch content.
Detection Methods for CVE-2026-89957
Indicators of Compromise
- KVM guests on s390x hosts issuing successful AP instructions against adapters or domains the host has already removed from its AP configuration.
- Divergence between the host's active AP configuration (/sys/bus/ap/) and the shadow APCB reported for a running vfio-ap mediated device.
- Absence of guest APCB update events in kernel logs immediately after an AP adapter, usage domain, or control domain removal that should have emptied an mdev assignment.
Detection Strategies
- Audit running s390x kernels against the fixed commit hashes listed on the NVD entry for CVE-2026-89957 to identify unpatched hypervisors.
- Correlate mdev assignment changes with subsequent guest APCB update messages; missing updates after a last-device removal indicate the buggy code path executed.
- Track privileged operations on vfio_ap sysfs attributes such as assign_adapter, unassign_adapter, assign_domain, and assign_control_domain from host audit logs.
Monitoring Recommendations
- Forward s390x host kernel logs and auditd records for AP mediated device changes to a centralized analytics platform for correlation with guest cryptographic activity.
- Alert on any KVM guest continuing AP operations after the host removes the corresponding adapter or domain.
- Review hypervisor change windows to ensure administrative removals of AP resources are followed by verified guest APCB refreshes.
How to Mitigate CVE-2026-89957
Immediate Actions Required
- Inventory all IBM Z hosts running KVM with vfio-ap passthrough and identify kernels that predate the stable commits referenced below.
- Apply the vendor-provided kernel update that replaces the bitmap_andnot() return-value check with bitmap_intersects() in vfio_ap_mdev_hot_unplug_cfg().
- Restrict privileges required to modify AP mediated device assignments to a minimum set of hypervisor administrators.
Patch Information
The fix is available in upstream stable trees. Reference the following commits when validating distribution kernels: commit 04b35dd88c10, commit 3a9b049bbdc4, commit 753aa3bb1273, commit 917f509bfb88, commit c45753c32d45, and commit f58e824de857. Consume the corresponding fix from your Linux distribution vendor for supported kernels.
Workarounds
- Avoid removing the last AP adapter, usage domain, or control domain from an active vfio-ap mediated device on unpatched kernels; destroy and recreate the mdev instead.
- Where feasible, stop or migrate affected KVM guests before altering AP assignments so the guest APCB is rebuilt on next start.
- Segment sensitive cryptographic workloads onto hosts that have received the fix to preserve tenant isolation guarantees.
# Verify the running kernel and confirm the fix is present
uname -r
# Enumerate vfio-ap mediated devices and their current assignments
ls /sys/devices/vfio_ap/matrix/
for mdev in /sys/devices/vfio_ap/matrix/*/; do
echo "== $mdev =="
cat "$mdev/matrix" 2>/dev/null
cat "$mdev/control_domains" 2>/dev/null
done
# Cross-check with the host AP configuration
lszcrypt -V
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
