android_kernel_samsung_a7y1.../drivers/block
Denis Efremov 000d4401bc floppy: fix out-of-bounds read in copy_buffer
[ Upstream commit da99466ac243f15fbba65bd261bfc75ffa1532b6 ]

This fixes a global out-of-bounds read access in the copy_buffer
function of the floppy driver.

The FDDEFPRM ioctl allows one to set the geometry of a disk.  The sect
and head fields (unsigned int) of the floppy_drive structure are used to
compute the max_sector (int) in the make_raw_rw_request function.  It is
possible to overflow the max_sector.  Next, max_sector is passed to the
copy_buffer function and used in one of the memcpy calls.

An unprivileged user could trigger the bug if the device is accessible,
but requires a floppy disk to be inserted.

The patch adds the check for the .sect * .head multiplication for not
overflowing in the set_geometry function.

The bug was found by syzkaller.

Signed-off-by: Denis Efremov <efremov@ispras.ru>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 20:04:41 +02:00
..
aoe A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
drbd A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mtip32xx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
paride A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rsxx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xen-blkback A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
zram A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
amiflop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ataflop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
brd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
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: fix out-of-bounds read in copy_buffer 2020-04-06 20:04:41 +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 Revert "block/loop: Use global lock for ioctl() operation." 2020-04-06 16:40:42 +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 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
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