]> git.ipfire.org Git - thirdparty/systemd.git/commit
kmod-setup: load vsock_loopback alongside vsock
authorvlefebvre <valentin.lefebvre@suse.com>
Fri, 20 Mar 2026 14:25:09 +0000 (15:25 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 20 Mar 2026 19:25:55 +0000 (19:25 +0000)
commit7c1075fb8ff2d3b87fa463d542e2e00ac086cbd3
treeb54f633fad5fe6d93c82ba112f21cbd684045efd
parentbb7486db618f4cf5109abdfef797ee70c47223c0
kmod-setup: load vsock_loopback alongside vsock

Loading vmw_vsock_virtio_transport early at boot causes vsock to be
resident before any application opens an AF_VSOCK socket. Because the
kernel skips autoloading when the vsock module is already present,
vsock_loopback never gets loaded automatically, and any subsequent
bind() to VMADDR_CID_LOCAL fails with EADDRNOTAVAIL.

Fix this by explicitly loading vsock_loopback on virtio or VMWare
machines via the new may_have_vsock_looopback() helper, wich covers both
vmw_vsock_virtio_transport and vmware_vsock_vmci_transport case.
vsock_loopback is the only module that registers a transport for
VMADDR_CID_LOCAL (CID 1) and has no hard dependency from any of the
vsock transport modules.

Fixes: #41100
Follow-up for 381c78db491a7c5fad8697543dd36ebe9b848718
src/core/kmod-setup.c