linux-stable/drivers/block
Willy Tarreau e52da8e463 floppy: disable FDRAWCMD by default
commit 233087ca06 upstream.

Minh Yuan reported a concurrency use-after-free issue in the floppy code
between raw_cmd_ioctl and seek_interrupt.

[ It turns out this has been around, and that others have reported the
  KASAN splats over the years, but Minh Yuan had a reproducer for it and
  so gets primary credit for reporting it for this fix   - Linus ]

The problem is, this driver tends to break very easily and nowadays,
nobody is expected to use FDRAWCMD anyway since it was used to
manipulate non-standard formats.  The risk of breaking the driver is
higher than the risk presented by this race, and accessing the device
requires privileges anyway.

Let's just add a config option to completely disable this ioctl and
leave it disabled by default.  Distros shouldn't use it, and only those
running on antique hardware might need to enable it.

Link: https://lore.kernel.org/all/000000000000b71cdd05d703f6bf@google.com/
Link: https://lore.kernel.org/lkml/CAKcFiNC=MfYVW-Jt9A3=FPJpTwCD2PL_ULNCpsCVE5s8ZeBQgQ@mail.gmail.com
Link: https://lore.kernel.org/all/CAEAjamu1FRhz6StCe_55XY5s389ZP_xmCF69k987En+1z53=eg@mail.gmail.com
Reported-by: Minh Yuan <yuanmingbuaa@gmail.com>
Reported-by: syzbot+8e8958586909d62b6840@syzkaller.appspotmail.com
Reported-by: cruise k <cruise4k@gmail.com>
Reported-by: Kyungtae Kim <kt0755@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org>
Tested-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-01 17:22:22 +02:00
..
aoe for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
drbd drbd: set QUEUE_FLAG_STABLE_WRITES 2022-04-20 09:34:17 +02:00
mtip32xx block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-23 12:03:15 +01:00
null_blk null_blk: add error handling support for add_disk() 2021-08-23 12:55:46 -06:00
paride SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
rnbd block/rnbd-clt-sysfs: fix a couple uninitialized variable bugs 2021-10-12 10:39:57 -06:00
rsxx for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
xen-blkback isystem: trim/fixup stdarg.h and other headers 2021-08-19 09:02:55 +09:00
zram zram: off by one in read_block_state() 2021-11-18 19:17:10 +01:00
amiflop.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
ataflop.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
brd.c brd: reduce the brd_devices_mutex scope 2021-10-17 06:51:19 -06:00
cryptoloop.c cryptoloop: add a deprecation warning 2021-08-27 10:44:54 -06:00
floppy.c floppy: disable FDRAWCMD by default 2022-05-01 17:22:22 +02:00
Kconfig floppy: disable FDRAWCMD by default 2022-05-01 17:22:22 +02:00
loop.c loop: use sysfs_emit() in the sysfs xxx show() 2022-04-08 14:23:55 +02:00
loop.h loop: reduce the loop_ctl_mutex scope 2021-09-03 22:14:40 -06:00
Makefile
n64cart.c n64cart: convert bi_disk to bi_bdev->bd_disk fix build 2022-04-08 14:24:16 +02:00
nbd.c Revert "nbd: fix possible overflow on 'first_minor' in nbd_dev_add()" 2022-04-13 20:59:26 +02:00
pktcdvd.c block: move the bdi from the request_queue to the gendisk 2021-08-09 11:53:23 -06:00
ps3disk.c ps3disk: use memcpy_{from,to}_bvec 2021-08-02 13:37:27 -06:00
ps3vram.c ps3vram: use bvec_virt 2021-08-16 10:50:33 -06:00
rbd.c block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-23 12:03:15 +01:00
rbd_types.h
sunvdc.c Char / Misc driver updates for 5.14-rc1 2021-07-05 13:42:16 -07:00
swim.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
swim3.c swim3: use blk_mq_alloc_disk 2021-06-11 11:53:02 -06:00
swim_asm.S
sx8.c sx8: use the internal state machine to check if del_gendisk needs to be called 2021-08-12 10:29:36 -06:00
virtio_blk.c virtio-blk: Use blk_validate_block_size() to validate block size 2022-04-08 14:22:48 +02:00
xen-blkfront.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
z2ram.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00