remarkable-linux/drivers/block
Andy Whitcroft 04bc4dd86d floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl
commit 65eea8edc3 upstream.

The final field of a floppy_struct is the field "name", which is a pointer
to a string in kernel memory.  The kernel pointer should not be copied to
user memory.  The FDGETPRM ioctl copies a floppy_struct to user memory,
including this "name" field.  This pointer cannot be used by the user
and it will leak a kernel address to user-space, which will reveal the
location of kernel code and data and undermine KASLR protection.

Model this code after the compat ioctl which copies the returned data
to a previously cleared temporary structure on the stack (excluding the
name pointer) and copy out to userspace from there.  As we already have
an inparam union with an appropriate member and that memory is already
cleared even for read only calls make use of that as a temporary store.

Based on an initial patch by Brian Belleville.

CVE-2018-7755
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Broke up long line.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03 17:00:54 -07:00
..
aoe block: don't set bounce limit in blk_init_queue 2017-06-27 12:13:45 -06:00
drbd drbd: Fix drbd_request_prepare() discard handling 2018-08-24 13:09:09 +02:00
mtip32xx License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
paride cdrom: do not call check_disk_change() inside cdrom_open() 2018-05-30 07:52:34 +02:00
rsxx block: pass in queue to inflight accounting 2017-08-09 13:09:16 -06:00
xen-blkback Merge branch 'for-4.14/block' of git://git.kernel.dk/linux-block 2017-09-07 11:59:42 -07:00
zram drivers/block/zram/zram_drv.c: fix bug storing backing_dev 2018-09-09 19:55:58 +02:00
amiflop.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
ataflop.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
brd.c brd: fix overflow in __brd_direct_access 2017-09-25 08:56:05 -06:00
cryptoloop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
DAC960.c block: DAC960: shut up format-overflow warning 2017-07-29 09:00:03 -06:00
DAC960.h
floppy.c floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl 2018-10-03 17:00:54 -07:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
loop.c loop: remember whether sysfs_create_group() was done 2018-07-17 11:39:33 +02:00
loop.h loop: remember whether sysfs_create_group() was done 2018-07-17 11:39:33 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nbd.c nbd: don't allow invalid blocksize settings 2018-09-19 22:43:35 +02:00
null_blk.c block: null_blk: fix 'Invalid parameters' when loading module 2018-05-30 07:52:36 +02:00
pktcdvd.c pktcdvd: Fix possible Spectre-v1 for pkt_devs 2018-09-19 22:43:43 +02:00
ps3disk.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
ps3vram.c block/ps3vram: Check return of ps3vram_cache_init 2017-08-17 23:03:44 +10:00
rbd.c rbd: flush rbd_dev->watch_dwork after watch is unregistered 2018-07-03 11:25:03 +02:00
rbd_types.h rbd: RBD_V{1,2}_DATA_FORMAT macros 2017-02-20 12:16:15 +01:00
skd_main.c skd: Use kmem_cache_free 2017-10-09 08:31:27 -06:00
skd_s1120.h skd: Use __packed only when needed 2017-08-18 08:45:29 -06:00
smart1,2.h
sunvdc.c sunvdc: prevent sunvdc panic when mpgroup disk added to guest domain 2017-08-09 22:22:32 -07:00
swim.c block/swim: Fix IO error at end of medium 2018-04-29 11:33:17 +02:00
swim3.c block/swim: Rename macros to avoid inconsistent inverted logic 2018-04-29 11:33:17 +02:00
swim_asm.S
sx8.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
umem.c blk: remove bio_set arg from blk_queue_split() 2017-06-18 12:40:59 -06:00
umem.h
virtio_blk.c virtio_blk: Fix an SG_IO regression 2017-10-27 08:23:21 -06:00
xen-blkfront.c xen-blkfront: move negotiate_mq to cover all cases of new VBDs 2018-05-30 07:52:13 +02:00
xsysace.c block: don't set bounce limit in blk_init_queue 2017-06-27 12:13:45 -06:00
z2ram.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00