Re: [PATCH] nbd: restrict sockets to TCP and UDP
- To: Eric Dumazet <edumazet@google.com>
- Cc: Jens Axboe <axboe@kernel.dk>, Josef Bacik <josef@toxicpanda.com>, linux-kernel <linux-kernel@vger.kernel.org>, netdev@vger.kernel.org, Eric Dumazet <eric.dumazet@gmail.com>, syzbot+e1cd6bd8493060bd701d@syzkaller.appspotmail.com, Mike Christie <mchristi@redhat.com>, Yu Kuai <yukuai1@huaweicloud.com>, linux-block@vger.kernel.org, nbd@other.debian.org, Stefan Hajnoczi <stefanha@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>
- Subject: Re: [PATCH] nbd: restrict sockets to TCP and UDP
- From: "Richard W.M. Jones" <rjones@redhat.com>
- Date: Tue, 9 Sep 2025 18:16:13 +0100
- Message-id: <[🔎] 20250909171613.GB2390@redhat.com>
- In-reply-to: <[🔎] 20250909151851.GB1460@redhat.com>
- References: <[🔎] 20250909132243.1327024-1-edumazet@google.com> <[🔎] 20250909132936.GA1460@redhat.com> <[🔎] CANn89iLyxMYTw6fPzUeVcwLh=4=iPjHZOAjg5BVKeA7Tq06wPg@mail.gmail.com> <[🔎] CANn89iKdKMZLT+ArMbFAc8=X+Pp2XaVH7H88zSjAZw=_MvbWLQ@mail.gmail.com> <[🔎] 63c99735-80ba-421f-8ad4-0c0ec8ebc3ea@kernel.dk> <[🔎] CANn89iJiBuJ=sHbfKjR-bJe6p12UrJ_DkOgysmAQuwCbNEy8BA@mail.gmail.com> <[🔎] 20250909151851.GB1460@redhat.com>
So I was playing with this (see commands at end if you want to try)
and it turns out that the nbd-client program doesn't support vsock
anyway. Of course you could still call the kernel APIs directly to
set up the socket, but it wouldn't be straightforward.
nbd-client did support Sockets Direct Protocol (SDP) but support was
removed in 2023.
The userspace tools like nbdinfo (part of libnbd) work fine, but of
course that's not relevant to the kernel NBD client.
Rich.
Commands to test vsock:
$ virt-builder fedora-42
$ nbdkit --vsock memory 1G \
--run '
qemu-system-x86_64 -machine accel=kvm:tcg \
-cpu host -m 4096 \
-drive file=fedora-42.img,format=raw,if=virtio \
-device vhost-vsock-pci,guest-cid=3
'
Inside the guest:
# dnf install nbdinfo
# nbdinfo nbd+vsock:///
(details of the 1G RAM disk will be shown here)
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
Reply to: