oss-sec mailing list archives
Re: Systemd vsock sshd
From: Bastian Blank <bblank () thinkmo de>
Date: Tue, 3 Feb 2026 16:46:56 +0100
On Sat, Dec 27, 2025 at 08:46:49PM -0700, Greg Dahlman wrote:
**vsock exists in the global namespace** - Unlike "af_inet" sockets, vsock connections are not bound to a particular network namespace. By default they are visible to every namespace on the host.
Every address family in Linux needs to implement it's own namespace
handling. In 2007, all existing address families got a check to only
allow the inital network namespace. af_vsock is newer and never got
this check.
Every point after the first one is just a result, not a cause.
So a fix would be something like that (untested, no time right now):
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -2553,6 +2553,9 @@ static int vsock_create(struct net *net, struct socket *sock,
if (protocol && protocol != PF_VSOCK)
return -EPROTONOSUPPORT;
+ if (!net_eq(net, &init_net))
+ return -EAFNOSUPPORT;
+
switch (sock->type) {
case SOCK_DGRAM:
sock->ops = &vsock_dgram_ops;
But I have a question: why do you name sshd, while every AF_VSOCK
listener is affected?
Bastian
--
Warp 7 -- It's a law we can live with.
Current thread:
- Re: Systemd vsock sshd wish42offcl98 (Jan 02)
- Re: Systemd vsock sshd Greg Dahlman (Jan 02)
- Re: Systemd vsock sshd Carlos Rodriguez-Fernandez (Jan 02)
- <Possible follow-ups>
- Re: Systemd vsock sshd Solar Designer (Jan 08)
- Re: Systemd vsock sshd Greg Dahlman (Jan 08)
- Re: Systemd vsock sshd Bastian Blank (Feb 03)
- Re: Systemd vsock sshd Solar Designer (Feb 18)
- Re: Systemd vsock sshd Greg Dahlman (Jan 02)
