]> git.ipfire.org Git - thirdparty/systemd.git/commit
socket-util: filter out VMADDR_CID_ANY in vsock_get_local_cid() 41230/head
authorNick Rosbrook <enr0n@ubuntu.com>
Fri, 20 Mar 2026 15:23:39 +0000 (11:23 -0400)
committerNick Rosbrook <enr0n@ubuntu.com>
Fri, 20 Mar 2026 15:37:31 +0000 (11:37 -0400)
commit83359c4da02a82d2972cf957d9855ea957359287
tree2e741123d37f17e39906979226e031a02b54de5a
parent4341ba091dd1074d3d8c41e2a4e6f155d0a7b79f
socket-util: filter out VMADDR_CID_ANY in vsock_get_local_cid()

It has been observed on some systems[1] that ssh-issue may print out:

 Try contacting this VM's SSH server via 'ssh vsock%4294967295' from host.

i.e. it suggests connecting with VMADDR_CID_ANY, which is not valid. It
seems that IOCTL_VM_SOCKETS_GET_LOCAL_CID may return VMADDR_CID_ANY in
some cases, e.g. when vsock is not full initialized or so.

Treat VMADDR_CID_ANY as special in vsock_get_local_cid(), the same as
VMADDR_CID_LOCAL and VMADDR_CID_HOST, and return an error.

[1] https://launchpad.net/bugs/2145027
src/basic/socket-util.c