mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
The vhost-user (fs, net, block, generic) and vsock worker threads allow socket() unconditionally in their seccomp rules. These threads only ever open AF_UNIX sockets: the vhost-user transport connects/binds a Unix socket (via the vhost crate's Endpoint/Listener), and the vsock device's host side is a Unix socket. None of them open AF_INET/AF_INET6 sockets. Restrict their socket() rule to AF_UNIX. Because these threads are spawned by the VMM thread and inherit its filter, socket() was already limited to the VMM's set (AF_UNIX/AF_INET/AF_INET6); this narrows it further to just AF_UNIX, so each worker is confined to what it actually uses rather than the broader inherited set. Related to #8490 (giving each thread a more restrictive filter than the VMM thread). Signed-off-by: Henry Hrvoje Tonkovac <htonkovac@gmail.com> Assisted-by: Claude:Opus-4.8