CVE-2026-13212: Zephyr virtio driver calls an arbitrary function pointer from an out-of-range used-ring descriptor id

Published Aug 24, 2026
·
Updated

The Zephyr virtio driver does not validate the descriptor-chain head id that the virtio device writes into the used ring. In virtioisr() (drivers/virtio/virtiocommon.c), the device-written vq->used->ring[idx].id is used directly as an index into vq->recvcbs[] and vq->desc[], which are both allocated with exactly vq->num entries. recvcbs[] holds {cb, opaque} callback entries, and the indexed callback pointer is then invoked as cbe.cb(cbe.opaque, usedlen).

Because the id is consumed as a 16-bit value with no bound check, a malicious or compromised virtio backend (an untrusted hypervisor, or an untrusted hardware/peer-processor virtio device on a PCI or MMIO transport) can supply an id far beyond vq->num. This causes an out-of-bounds read of a {function pointer, argument} pair from heap memory beyond recvcbs[], after which the driver calls that attacker-shaped pointer in the guest's interrupt context. No guest privileges or user interaction are required; the backend triggers it by writing the shared used ring and raising the queue interrupt.

The result is an arbitrary / attacker-influenced function-pointer call in the Zephyr guest, i.e. a control-flow-hijack primitive that can lead to code execution or, at minimum, a reliable crash. The fix rejects any used-ring id >= vq->num before indexing recvcbs[]/desc[] or invoking the callback. This affects builds using CONFIGVIRTIO with the PCI or MMIO transport.

Affected Software

1 affected component
Zephyr RTOS virtio driver

Event History

Aug 24, 2026
CVE Published
via MITRE·03:43 PM
Data Sourced
via MITRE·03:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are realistically exposed?

Zephyr guests using virtio are exposed when their virtio backend is malicious or compromised. This includes untrusted hypervisors and untrusted hardware or peer-processor virtio devices using PCI or MMIO transports.

2

What does an attacker need to exploit this?

The attacker needs control of the virtio backend such that it can write a crafted descriptor-chain head ID into the shared used ring and raise the queue interrupt. No guest privileges or user interaction are required.

3

What is the practical impact of successful exploitation?

A crafted out-of-range ID causes the driver to read a callback pointer and argument from beyond the recv_cbs allocation and invoke that pointer in guest interrupt context. This provides an attacker-influenced function-pointer call and a control-flow-hijack primitive in the Zephyr guest.

4

How can I identify the vulnerable behavior in source?

Inspect drivers/virtio/virtio_common.c, specifically virtio_isr(), for use of vq->used->ring[idx].id as an index into vq->recv_cbs[] or vq->desc[] without verifying that the ID is less than vq->num. The relevant callback is then invoked through cbe.cb(cbe.opaque, used_len).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203