linux/drivers/block
Josef Bacik b98e762e3d nbd: freeze the queue while we're adding connections
When setting up a device, we can krealloc the config->socks array to add
new sockets to the configuration.  However if we happen to get a IO
request in at this point even though we aren't setup we could hit a UAF,
as we deref config->socks without any locking, assuming that the
configuration was setup already and that ->socks is safe to access it as
we have a reference on the configuration.

But there's nothing really preventing IO from occurring at this point of
the device setup, we don't want to incur the overhead of a lock to
access ->socks when it will never change while the device is running.
To fix this UAF scenario simply freeze the queue if we are adding
sockets.  This will protect us from this particular case without adding
any additional overhead for the normal running case.

Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-25 11:04:50 -07:00
..
aoe aoe: don't call set_capacity from irq context 2020-11-16 08:34:14 -07:00
drbd block: switch partition lookup to use struct block_device 2020-12-01 14:53:40 -07:00
mtip32xx mtip32xx: remove the call to fsync_bdev on removal 2020-12-01 14:53:38 -07:00
null_blk null_blk: Move driver into its own directory 2020-12-07 17:36:04 -07:00
paride paride/pcd: use bdev_check_media_change 2020-09-10 09:32:31 -06:00
rnbd block/rnbd-clt: avoid module unload race with close confirmation 2021-01-08 08:19:18 -07:00
rsxx rsxx: Use fallthrough pseudo-keyword 2020-10-02 17:54:45 -06:00
xen-blkback for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
zram for-5.11/block-2020-12-14 2020-12-16 12:57:51 -08:00
amiflop.c amiflop: use separate gendisks for Amiga vs MS-DOS mode 2020-11-16 08:14:30 -07:00
ataflop.c ataflop: use a separate gendisk for each media format 2020-11-16 08:14:31 -07:00
brd.c brd: use __register_blkdev to allocate devices on demand 2020-11-16 08:14:30 -07:00
cryptoloop.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 30 2019-05-24 17:27:10 +02:00
floppy.c floppy: use a separate gendisk for each media format 2020-11-16 08:14:30 -07:00
Kconfig block: rsxx: select CONFIG_CRC32 2021-01-03 14:54:43 -07:00
loop.c for-5.11/drivers-2020-12-14 2020-12-16 13:09:32 -08:00
loop.h block/loop: Use global lock for ioctl() operation. 2018-11-08 06:30:11 -07:00
Makefile null_blk: Move driver into its own directory 2020-12-07 17:36:04 -07:00
nbd.c nbd: freeze the queue while we're adding connections 2021-01-25 11:04:50 -07:00
pktcdvd.c pktcdvd: use set_capacity_and_notify 2020-11-16 08:34:14 -07:00
ps3disk.c powerpc/ps3: make system bus's remove and shutdown callbacks return void 2020-12-04 01:01:22 +11:00
ps3vram.c powerpc/ps3: make system bus's remove and shutdown callbacks return void 2020-12-04 01:01:22 +11:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
rbd.c The big ticket item here is support for msgr2 on-wire protocol, which 2020-12-17 11:53:52 -08:00
skd_main.c skd_main: remove unused including <linux/version.h> 2020-10-17 08:11:14 -06:00
skd_s1120.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
sunvdc.c compat_ioctl: block: handle cdrom compat ioctl in non-cdrom drivers 2020-01-03 09:33:15 +01:00
swim3.c swim3: use bdev_check_media_changed 2020-09-10 09:32:31 -06:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim.c swim: don't call blk_register_region 2020-11-16 08:14:30 -07:00
sx8.c sx8: use a per-host tag_set 2018-11-09 08:14:14 -07:00
umem.c block: move ->make_request_fn to struct block_device_operations 2020-07-01 07:27:24 -06:00
umem.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 348 2019-06-05 17:37:08 +02:00
virtio_blk.c virtio-blk: remove a spurious call to revalidate_disk_size 2020-11-16 08:34:15 -07:00
xen-blkfront.c xen: branch for v5.11-rc1b 2020-12-19 12:56:23 -08:00
xsysace.c xsysace: use platform_get_resource() and platform_get_irq_optional() 2020-10-29 08:22:33 -06:00
z2ram.c z2ram: use separate gendisk for the different modes 2020-11-16 08:14:31 -07:00