linux/drivers/block
Eric Dumazet 37ad11f20e nbd: restrict sockets to TCP and UDP
[ Upstream commit 9f7c02e031 ]

Recently, syzbot started to abuse NBD with all kinds of sockets.

Commit cf1b2326b7 ("nbd: verify socket is supported during setup")
made sure the socket supported a shutdown() method.

Explicitely accept TCP and UNIX stream sockets.

Fixes: cf1b2326b7 ("nbd: verify socket is supported during setup")
Reported-by: syzbot+e1cd6bd8493060bd701d@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/CANn89iJ+76eE3A_8S_zTpSyW5hvPRn6V57458hCZGY5hbH_bFA@mail.gmail.com/T/#m081036e8747cd7e2626c1da5d78c8b9d1e55b154
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Richard W.M. Jones <rjones@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Yu Kuai <yukuai1@huaweicloud.com>
Cc: linux-block@vger.kernel.org
Cc: nbd@other.debian.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-15 11:59:59 +02:00
..
aoe aoe: defer rexmit timer downdev work to workqueue 2025-07-10 16:05:07 +02:00
drbd drbd: add missing kref_get in handle_write_conflicts 2025-08-20 18:30:20 +02:00
mtip32xx [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
null_blk null_blk: Fix the description of the cache_size module argument 2025-10-15 11:59:59 +02:00
rnbd block/rnbd-srv: Add sanity check and remove redundant assignment 2024-08-28 08:50:35 -06:00
xen-blkback xen/blkback: add missing MODULE_DESCRIPTION() macro 2024-07-10 00:21:18 -06:00
zram zram: fix potential UAF of zram table 2025-01-23 17:22:58 +01:00
amiflop.c Merge branch 'for-6.11/block-limits' into for-6.11/block 2024-06-19 08:14:49 -06:00
ataflop.c Merge branch 'for-6.11/block-limits' into for-6.11/block 2024-06-19 08:14:49 -06:00
brd.c brd: fix discard end sector 2025-06-19 15:31:28 +02:00
floppy.c floppy: add missing MODULE_DESCRIPTION() macro 2024-07-10 00:22:03 -06:00
Kconfig rust: block: add rnull, Rust null_blk implementation 2024-06-14 07:45:04 -06:00
loop.c loop: Avoid updating block size under exclusive owner 2025-08-20 18:30:20 +02:00
Makefile rust: block: add rnull, Rust null_blk implementation 2024-06-14 07:45:04 -06:00
n64cart.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
nbd.c nbd: restrict sockets to TCP and UDP 2025-10-15 11:59:59 +02:00
pktcdvd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ps3disk.c ps3disk: Do not use dev->bounce_size before it is set 2025-02-08 09:56:51 +01:00
ps3vram.c block: pass a queue_limits argument to blk_alloc_disk 2024-02-19 16:58:23 -07:00
rbd.c A small patchset to address bogus I/O errors and ultimately an 2024-07-26 10:34:42 -07:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
rnull.rs rust: treewide: switch to our kernel Box type 2025-03-13 13:01:44 +01:00
sunvdc.c sunvdc: Balance device refcount in vdc_port_mpgroup_check 2025-08-20 18:30:15 +02:00
swim.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
swim3.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ublk_drv.c ublk: use vmalloc for ublk_device's __queues 2025-08-15 12:13:32 +02:00
virtio_blk.c block: add a queue_limits_commit_update_frozen helper 2025-09-09 18:58:24 +02:00
xen-blkfront.c xen-blkfront: fix sector_size propagation to the block layer 2024-07-02 08:58:12 -06:00
z2ram.c z2ram: add missing MODULE_DESCRIPTION() macro 2024-06-19 07:54:00 -06:00