Skip to content

virtio-devices: allow sendto in the virtio-mem thread - #4

Open
azenla wants to merge 1 commit into
edera/v54.xfrom
alex/fix/virtio-mem-sendto
Open

azenla wants to merge 1 commit into
edera/v54.xfrom
alex/fix/virtio-mem-sendto

Conversation

@azenla

@azenla azenla commented Nov 17, 2026

Copy link
Copy Markdown
Member

A guest with a vfio-user device and a virtio-mem memory zone kills the VMM with SIGSYS when it gives memory back:

Probable seccomp violation: si_syscall=44 si_arch=0xc000003e thread=memz0

On unplug, the virtio-mem thread asks the vfio-user client to unmap the range. vfio_user::Client::dma_unmap sends the request with write_all, which is send(2), and the virtio-mem seccomp filter only allows sendmsg and recvfrom. DMA map is not affected because it passes an fd and uses sendmsg.

This adds sendto to the virtio-mem thread rules.

Tested with a guest on a virtio-mem zone (--memory size=0,hotplug_method=virtio-mem --memory-zone id=memz0,size=512M,shared=on,hotplug_size=1G) and a vfio-user device (--user-device), resizing the zone up and down with ch-remote resize-zone: before the change the VMM dies on the shrink, after it the VMM keeps running and shuts down cleanly. Also tested with an Edera KVM zone that runs its disks on a vfio-user NVMe device.

A vfio-user DMA unmap on virtio-mem unplug writes to the client socket with
send(2), which the virtio-mem seccomp filter refused, so the VMM died with
SIGSYS when a guest with a vfio-user device shrank its memory.

Signed-off-by: Alex Zenla <alex@edera.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants