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

virtio: fix use-after-free in unregister_virtio_device()

device_unregister() is device_del() plus put_device(). When the caller
holds no extra reference, that drops the last one and runs the release
callback, which for several transports frees the memory the embedded
struct virtio_device sits in. unregister_virtio_device() then calls
virtio_debug_device_exit(), which reads dev->debugfs_dir out of the freed
object.

Affected transports are the ones whose release callback frees and whose
remove path takes no reference: virtio_mmio, virtio_vdpa, virtio_uml,
mlxbf-tmfifo and virtio_ccw. virtio_pci is unaffected because
virtio_pci_remove() brackets the call with get_device() and put_device().

Remove the debugfs entries before the device can go away. They are only
accessed through the protected debugfs interface, so
debugfs_remove_recursive() waits for in-progress file operations before
returning. Tearing them down while the device is still alive is therefore
safe.

Reproduced on User-Mode Linux with CONFIG_KASAN and CONFIG_VIRTIO_DEBUG
by unbinding a virtio-uml device:

BUG: KASAN: slab-use-after-free in virtio_debug_device_exit+0x36/0x4d
Read of size 8 at addr 00000000616e0b10 by task init/1
__asan_report_load8_noabort
virtio_debug_device_exit+0x36/0x4d
unregister_virtio_device+0x48/0x75
virtio_uml_remove
platform_remove
device_release_driver_internal
unbind_store

Freed by task 1:
kfree
virtio_uml_release_dev
device_release
kobject_put
put_device
device_unregister

With this applied, the report is gone and unbind is clean.
Published: 2026-09-25
Score: n/a
EPSS: n/a
KEV: No
Impact: Use-After-Free leading to unauthorized memory access
Action: Apply Patch
AI Analysis

Impact

The kernel function unregister_virtio_device() performed device removal and released device references that freed the memory holding the virtio_device structure. After the object had been freed, the code still accessed the object’s debugfs_dir field inside virtio_debug_device_exit(), resulting in a use‑after‑free error that allowed arbitrary reads of memory that had just been reclaimed. This type of memory corruption could be leveraged by an attacker to compromise kernel integrity, potentially escalating privileges or enabling other attacks.

Affected Systems

The flaw affects Linux kernel versions that include the legacy virtio transports virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo, and virtio_ccw, and that have not yet applied the official patch. These transports are used in various virtualization and hardware emulation scenarios under the Linux kernel. The kernel module configuration must contain the enabled virtio drivers for the vulnerability to be present.

Risk and Exploitability

The EPSS score for this issue is not available and the vulnerability is not listed in the CISA KEV catalog, so publicly documented exploitation is not known. However, because the attack requires unbinding a virtio device—which generally requires privileged or local access—a determined local attacker could exploit the use‑after‑free to read kernel memory or corrupt the heap, providing a foothold for privilege escalation. No CVSS score is supplied, but the nature of the flaw suggests significant impact if successfully exploited. The fix removes the debugfs entry before the device is finalized, eliminating the use‑after‑free path.

Generated by OpenCVE AI on September 25, 2026 at 15:27 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the kernel patch that eliminates the use‑after‑free in unregister_virtio_device().
  • If the kernel is built with the affected virtio transports and they are not required, disable or unload the virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo, and virtio_ccw modules to reduce exposure.
  • Configure the kernel with CONFIG_VIRTIO_DEBUG disabled to remove the debugfs component and avoid the code path that referenced freed memory.

Generated by OpenCVE AI on September 25, 2026 at 15:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 25 Sep 2026 15:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Fri, 25 Sep 2026 10:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: virtio: fix use-after-free in unregister_virtio_device() device_unregister() is device_del() plus put_device(). When the caller holds no extra reference, that drops the last one and runs the release callback, which for several transports frees the memory the embedded struct virtio_device sits in. unregister_virtio_device() then calls virtio_debug_device_exit(), which reads dev->debugfs_dir out of the freed object. Affected transports are the ones whose release callback frees and whose remove path takes no reference: virtio_mmio, virtio_vdpa, virtio_uml, mlxbf-tmfifo and virtio_ccw. virtio_pci is unaffected because virtio_pci_remove() brackets the call with get_device() and put_device(). Remove the debugfs entries before the device can go away. They are only accessed through the protected debugfs interface, so debugfs_remove_recursive() waits for in-progress file operations before returning. Tearing them down while the device is still alive is therefore safe. Reproduced on User-Mode Linux with CONFIG_KASAN and CONFIG_VIRTIO_DEBUG by unbinding a virtio-uml device: BUG: KASAN: slab-use-after-free in virtio_debug_device_exit+0x36/0x4d Read of size 8 at addr 00000000616e0b10 by task init/1 __asan_report_load8_noabort virtio_debug_device_exit+0x36/0x4d unregister_virtio_device+0x48/0x75 virtio_uml_remove platform_remove device_release_driver_internal unbind_store Freed by task 1: kfree virtio_uml_release_dev device_release kobject_put put_device device_unregister With this applied, the report is gone and unbind is clean.
Title virtio: fix use-after-free in unregister_virtio_device()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-09-25T10:23:26.913Z

Reserved: 2026-09-25T10:18:58.209Z

Link: CVE-2026-97996

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-25T11:17:27.880

Modified: 2026-09-25T11:17:27.880

Link: CVE-2026-97996

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-25T15:30:06Z

Weaknesses