Re: [syzbot] [net?] possible deadlock in inet_shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux