On Fri, Sep 5, 2025 at 1:03 PM Eric Dumazet <edumazet@xxxxxxxxxx> wrote: > > On Fri, Sep 5, 2025 at 1:00 PM syzbot > <syzbot+e1cd6bd8493060bd701d@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote: Note to NBD maintainers : I held about 20 syzbot reports all pointing to NBD accepting various sockets, I can release them if needed, if you prefer to triage them. > > Question to NBD maintainers. > > What socket types are supposed to be supported by NBD ? > > I was thinking adding a list of supported ones, assuming TCP and > stream unix are the only ones: > > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c > index 6463d0e8d0ce..87b0b78249da 100644 > --- a/drivers/block/nbd.c > +++ b/drivers/block/nbd.c > @@ -1217,6 +1217,14 @@ static struct socket *nbd_get_socket(struct > nbd_device *nbd, unsigned long fd, > if (!sock) > return NULL; > > + if (!sk_is_tcp(sock->sk) && > + !sk_is_stream_unix(sock->sk)) { > + dev_err(disk_to_dev(nbd->disk), "Unsupported socket: > should be TCP or UNIX.\n"); > + *err = -EINVAL; > + sockfd_put(sock); > + return NULL; > + } > + > if (sock->ops->shutdown == sock_no_shutdown) { > dev_err(disk_to_dev(nbd->disk), "Unsupported socket: > shutdown callout must be supported.\n"); > *err = -EINVAL;