android_kernel_samsung_a7y1.../drivers/block
Linus Torvalds 9e7dc48c02 floppy: check FDC index for errors before assigning it
commit 2e90ca68b0d2f5548804f22f0dd61145516171e3 upstream.

Jordy Zomer reported a KASAN out-of-bounds read in the floppy driver in
wait_til_ready().

Which on the face of it can't happen, since as Willy Tarreau points out,
the function does no particular memory access.  Except through the FDCS
macro, which just indexes a static allocation through teh current fdc,
which is always checked against N_FDC.

Except the checking happens after we've already assigned the value.

The floppy driver is a disgrace (a lot of it going back to my original
horrd "design"), and has no real maintainer.  Nobody has the hardware,
and nobody really cares.  But it still gets used in virtual environment
because it's one of those things that everybody supports.

The whole thing should be re-written, or at least parts of it should be
seriously cleaned up.  The 'current fdc' index, which is used by the
FDCS macro, and which is often shadowed by a local 'fdc' variable, is a
prime example of how not to write code.

But because nobody has the hardware or the motivation, let's just fix up
the immediate problem with a nasty band-aid: test the fdc index before
actually assigning it to the static 'fdc' variable.

Reported-by: Jordy Zomer <jordy@simplyhacker.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:01:14 +02:00
..
aoe A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
drbd signal: Allow cifs and drbd to receive their terminating signals 2020-04-07 13:42:54 +02:00
mtip32xx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
paride A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rsxx rsxx: add missed destroy_workqueue calls in remove 2020-04-07 12:44:10 +02:00
xen-blkback A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
zram A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
amiflop.c amiflop: clean up on errors during setup 2020-04-07 12:34:38 +02:00
ataflop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
brd.c brd: check and limit max_part par 2020-04-07 13:57:30 +02:00
cciss_cmd.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cciss_scsi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cciss_scsi.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cciss.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cciss.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpqarray.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpqarray.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cryptoloop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
DAC960.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
DAC960.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
floppy.c floppy: check FDC index for errors before assigning it 2020-04-07 14:01:14 +02:00
hd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ida_cmd.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ida_ioctl.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
loop.c loop: Add LOOP_SET_DIRECT_IO to compat ioctl 2020-04-07 09:25:58 +02:00
loop.h Revert "block/loop: Use global lock for ioctl() operation." 2020-04-06 16:40:42 +02:00
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mg_disk.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nbd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
null_blk.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
osdblk.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pktcdvd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ps3disk.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ps3vram.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rbd_types.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rbd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
skd_main.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
skd_s1120.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
smart1,2.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sunvdc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
swim_asm.S A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
swim.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
swim3.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sx8.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
umem.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
umem.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
virtio_blk.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xen-blkfront.c xen/blkfront: Adjust indentation in xlvbd_alloc_gendisk 2020-04-07 13:38:45 +02:00
xsysace.c xsysace: Fix error handling in ace_setup 2020-04-06 16:42:28 +02:00
z2ram.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30