android_kernel_oneplus_msm8998/drivers/block
Denis Efremov d105eaf5fb 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>
2019-08-04 09:34:52 +02:00
..
aoe
drbd drbd: skip spurious timeout (ping-timeo) when failing promote 2019-02-20 10:13:11 +01:00
mtip32xx Revert "mtip32xx: use runtime tag to initialize command header" 2018-04-08 11:52:02 +02:00
paride cdrom: do not call check_disk_change() inside cdrom_open() 2018-05-30 07:49:13 +02:00
rsxx
xen-blkback xen-blkback: don't leak stack data via response ring 2017-11-21 09:21:17 +01:00
zram zram: close udev startup race condition as default groups 2018-11-27 16:08:01 +01:00
amiflop.c
ataflop.c ataflop: fix error handling during setup 2018-11-21 09:27:31 +01:00
brd.c
cciss.c
cciss.h
cciss_cmd.h
cciss_scsi.c
cciss_scsi.h
cpqarray.c
cpqarray.h
cryptoloop.c
DAC960.c
DAC960.h
floppy.c floppy: fix out-of-bounds read in copy_buffer 2019-08-04 09:34:52 +02:00
hd.c
ida_cmd.h
ida_ioctl.h
Kconfig
loop.c Revert "block/loop: Use global lock for ioctl() operation." 2019-05-16 19:44:52 +02:00
loop.h Revert "block/loop: Use global lock for ioctl() operation." 2019-05-16 19:44:52 +02:00
Makefile
mg_disk.c
nbd.c
null_blk.c
osdblk.c
pktcdvd.c pktcdvd: Fix pkt_setup_dev() error path 2018-02-16 20:09:47 +01:00
ps3disk.c
ps3vram.c
rbd.c rbd: set max_segments to USHRT_MAX 2018-01-17 09:35:30 +01:00
rbd_types.h
skd_main.c skd: Submit requests to firmware before triggering the doorbell 2017-09-27 11:00:14 +02:00
skd_s1120.h
smart1,2.h
sunvdc.c sunvdc: Do not spin in an infinite loop when vio_ldc_send() returns EAGAIN 2019-02-20 10:13:06 +01:00
swim.c swim: fix cleanup on setup error 2018-11-21 09:27:31 +01:00
swim3.c block/swim3: Fix -EBUSY error when re-opening device after unmount 2019-02-20 10:13:13 +01:00
swim_asm.S
sx8.c
umem.c
umem.h
virtio_blk.c virtio_blk: fix panic in initialization error path 2017-08-11 09:08:58 -07:00
xen-blkfront.c
xsysace.c xsysace: Fix error handling in ace_setup 2019-05-16 19:45:02 +02:00
z2ram.c