Skip to main content
Vulnerability Database/CVE-2026-97996

CVE-2026-97996: Linux Kernel Use-After-Free Vulnerability

CVE-2026-97996 is a use-after-free flaw in the Linux kernel virtio subsystem that can lead to memory corruption when unregistering virtio devices. This article covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-97996 Overview

CVE-2026-97996 is a use-after-free vulnerability in the Linux kernel's virtio subsystem, specifically in unregister_virtio_device(). The function calls device_unregister(), which combines device_del() and put_device(). When no extra reference is held, the final put drops the reference and triggers the release callback. Several transports free the memory containing the embedded struct virtio_device at that point. The subsequent call to virtio_debug_device_exit() then reads dev->debugfs_dir from the freed object, producing a KASAN slab-use-after-free report.

Affected transports include virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo, and virtio_ccw. The virtio_pci transport is unaffected because virtio_pci_remove() brackets the call with get_device() and put_device().

Critical Impact

A local actor with the ability to unbind virtio devices can trigger a kernel use-after-free, risking memory corruption, kernel information disclosure, and potential privilege escalation on affected systems.

Affected Products

  • Linux kernel virtio subsystem, specifically unregister_virtio_device()
  • Transports: virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo, and virtio_ccw
  • Kernel builds with CONFIG_VIRTIO_DEBUG (reproduced under User-Mode Linux with CONFIG_KASAN)

Discovery Timeline

  • 2026-09-25 - CVE-2026-97996 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-97996

Vulnerability Analysis

The flaw is a classic use-after-free [CWE-416] triggered during device teardown in the Linux kernel's virtio core. unregister_virtio_device() invokes device_unregister(), which internally performs device_del() followed by put_device(). If no caller-held reference exists at that moment, the put_device() call drops the final reference and immediately runs the device's release callback.

For the affected transports, the release callback frees the containing structure that embeds struct virtio_device. Control then returns to unregister_virtio_device(), which calls virtio_debug_device_exit(). That function dereferences dev->debugfs_dir on an object that no longer exists, resulting in reads from freed slab memory.

Root Cause

The root cause is lifetime mismanagement between the virtio core and transport-specific release callbacks. The virtio core accesses debug state on struct virtio_device after releasing the final reference. Transports such as virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo, and virtio_ccw do not take an extra reference across removal, so the release callback free runs before the debug teardown. virtio_pci avoids the issue because virtio_pci_remove() wraps the sequence with get_device() and put_device().

Attack Vector

Exploitation requires local access with the ability to unbind a virtio device, for example through sysfsunbind on a platform device. The reporter reproduced the bug on User-Mode Linux with CONFIG_KASAN and CONFIG_VIRTIO_DEBUG by unbinding a virtio-uml device. KASAN reported a slab-use-after-free in virtio_debug_device_exit+0x36/0x4d reached through unregister_virtio_device+0x48/0x75. The freed allocation originated from virtio_uml_release_dev via device_release and put_device.

No verified public exploit code is available for this issue. See the upstream fix commits referenced below for technical details.

Detection Methods for CVE-2026-97996

Indicators of Compromise

  • KASAN reports showing slab-use-after-free in virtio_debug_device_exit with a call path through unregister_virtio_device and a transport-specific release function such as virtio_uml_release_dev.
  • Unexpected kernel oops or panic logs correlated with virtio device unbind operations under /sys/bus/*/drivers/*/unbind.
  • Debugfs entries under virtio/ referencing devices that no longer appear in /sys/bus/virtio/devices/.

Detection Strategies

  • Enable CONFIG_KASAN and CONFIG_VIRTIO_DEBUG in test and pre-production kernels to surface the use-after-free deterministically during unbind testing.
  • Audit kernel versions deployed on virtualization hosts, SmartNICs using mlxbf-tmfifo, s390 guests using virtio_ccw, and User-Mode Linux instances to confirm whether patched commits are present.
  • Monitor kernel ring buffer and journald for BUG: KASAN entries and oops traces that reference virtio_debug_device_exit or unregister_virtio_device.

Monitoring Recommendations

  • Forward dmesg and /var/log/kern.log to a central logging pipeline and alert on virtio-related oops signatures.
  • Track driver bind and unbind events through audit rules on /sys/bus/*/drivers/*/unbind to correlate operator actions with subsequent kernel faults.
  • Baseline the set of users and services permitted to perform device unbind, and alert on deviations.

How to Mitigate CVE-2026-97996

Immediate Actions Required

  • Apply the upstream Linux kernel fix that removes debugfs entries before the device can be released, ensuring debugfs_remove_recursive() runs while the device is still alive.
  • Rebuild and deploy kernels incorporating the fix commits 3f9a0fc, 77dbd10, 951cad5, and caf0421.
  • Restrict local privileges that permit writing to unbind sysfs attributes for virtio transports.

Patch Information

The fix tears down debugfs entries before the device reference can be dropped. Because debugfs file operations are serialized through the debugfs interface, debugfs_remove_recursive() waits for in-progress operations before returning, so removing the entries while the device is still live is safe. Patched kernels no longer touch dev->debugfs_dir after the release callback has freed the embedding structure. Distribution advisories should be consulted for backports to supported stable branches.

Workarounds

  • Disable CONFIG_VIRTIO_DEBUG on builds where debugfs instrumentation is not required, which avoids the vulnerable code path in virtio_debug_device_exit().
  • Avoid runtime unbind of affected virtio transports (virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo, virtio_ccw) until patched kernels are deployed.
  • Limit shell and sysfs access on affected hosts so only trusted administrators can issue driver unbind operations.
bash
# Verify running kernel and confirm patched commits are present
uname -r
zcat /proc/config.gz | grep -E 'CONFIG_VIRTIO_DEBUG|CONFIG_KASAN'

# Restrict write access to driver unbind interfaces (example hardening)
find /sys/bus/virtio/drivers -name unbind -exec chmod 600 {} \;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.