Using virtio-interfaces with dpdk leads to assert and crash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu (Ubuntu) |
Fix Released
|
Medium
|
Matthew Ruffell | ||
Noble |
Fix Released
|
Medium
|
Matthew Ruffell | ||
Oracular |
Fix Released
|
Medium
|
Matthew Ruffell |
Bug Description
[Impact]
If you start a QEMU VM with a dpdk backed virtio-interface, the VM can hit a user triggerable crash during boot.
qemu-system-x86_64: accel/kvm/
2024-08-24 17:46:20.823+0000: shutting down, reason=crashed
This has been assigned CVE-2024-4693.
There is no workaround, other than to not use dpdk backed virtio-interfaces, and use a generic network device instead.
[Testcase]
Deploy a bare metal host running Noble.
Install a KVM stack:
$ sudo apt-get install qemu-kvm libvirt-
Set up DPDK with Open vSwitch by following the Ubuntu Server Docs:
https:/
$ sudo apt-get install openvswitch-
$ sudo update-alternatives --set ovs-vswitchd /usr/lib/
$ ovs-vsctl set Open_vSwitch . "other_
# run on core 0 only
$ ovs-vsctl set Open_vSwitch . "other_
# Allocate 2G huge pages (not Numa node aware)
$ ovs-vsctl set Open_vSwitch . "other_
# limit to one whitelisted device
$ ovs-vsctl set Open_vSwitch . "other_
$ sudo service openvswitch-switch restart
Attach DPDK ports to Open vSwitch
$ ovs-vsctl add-br ovsdpdkbr0 -- set bridge ovsdpdkbr0 datapath_
$ ovs-vsctl add-port ovsdpdkbr0 dpdk0 -- set Interface dpdk0 type=dpdk "options:
Open vSwitch DPDK to KVM guests
$ ovs-vsctl add-port ovsdpdkbr0 vhost-user-1 -- set Interface vhost-user-1 type=dpdkvhostu
Start a noble instance in KVM, e.g. with uvt-kvm
$ uvt-kvm create --cpu 4 --memory 4096 --disk 10 noble-test release=noble arch=amd64
Edit the virsh to add the dpdk virtio interface
$ virsh edit noble-test
<interface type='vhostuser'>
<source type='unix'
path='/
mode='server'/>
<model type='virtio'/>
</interface>
Restart the vm, and qemu should hit the assert:
qemu-system-x86_64: accel/kvm/
2024-08-24 17:46:20.823+0000: shutting down, reason=crashed
Alternatively, you can follow the instructions in the upstream bug:
Run dpdk-testpmd as vhost-user backend in hypervisor:
$ build/app/
Prepare virtio device inside VM:
$ ifconfig eth1 down
$ echo 1024 > /sys/devices/
$ mount -t hugetlbfs nodev /mnt/huge
$ modprobe uio
$ insmod dpdk-kmods/
$ dpdk/usertools/
Run testpmd inside VM:
$ dpdk/build/
QEMU will crash.
If you install the test packages from the following ppa:
https:/
The crash should no longer occur.
[Where problems could occur]
This change affects the virtio-pci subsystem in qemu, by fixing up how interrupt vectors are assigned and released.
A regression was already reported in the primary patch upstream, see the below other info section. The followup patch was created to fix this regression, and is necessary.
If a regression were to occur in Ubuntu, it could affect any VM using virtio devices, which is the vast majority of VMs. There is no workaround, other than to remove the virtio-interfaces from the XML files to start the VM. Most users would downgrade instead until a fix is available.
[Other info]
This was fixed upstream in the following commits:
commit 2ce6cff94df2650
Author: Cindy Lu <email address hidden>
Date: Fri, 12 Apr 2024 14:26:55 +0800
Subject: virtio-pci: fix use of a released vector
Link: https:/
commit a8e63ff289d1371
Author: Cindy Lu <email address hidden>
Date: Tue Aug 6 17:37:12 2024 +0800
Subject: virtio-pci: Fix the use of an uninitialized irqfd
Link: https:/
Noble requires both, and Oracular requires the latter only.
Upstream bug:
https:/
Upstream bug for regression:
https:/
https:/
Ubuntu CVE tracker:
https:/
Changed in qemu (Ubuntu): | |
status: | New → Fix Released |
Changed in qemu (Ubuntu Noble): | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Matthew Ruffell (mruffell) |
tags: | added: sts |
Changed in qemu (Ubuntu Oracular): | |
status: | Fix Released → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Matthew Ruffell (mruffell) |
summary: |
- Using virtio-interfaces with dpdk leads to crash + Using virtio-interfaces with dpdk leads to assert and crash |
description: | updated |
tags: | added: patch |
Changed in qemu (Ubuntu): | |
status: | In Progress → Fix Released |
Debdiff for Noble that fixes this issue.