linux-brain/block
Mikulas Patocka 6eed26e35c block: fix an integer overflow in logical block size
commit ad6bf88a6c19a39fb3b0045d78ea880325dfcf15 upstream.

Logical block size has type unsigned short. That means that it can be at
most 32768. However, there are architectures that can run with 64k pages
(for example arm64) and on these architectures, it may be possible to
create block devices with 64k block size.

For exmaple (run this on an architecture with 64k pages):

Mount will fail with this error because it tries to read the superblock using 2-sector
access:
  device-mapper: writecache: I/O is not aligned, sector 2, size 1024, block size 65536
  EXT4-fs (dm-0): unable to read superblock

This patch changes the logical block size from unsigned short to unsigned
int to avoid the overflow.

Cc: stable@vger.kernel.org
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23 08:22:32 +01:00
..
partitions
Kconfig
Kconfig.iosched
Makefile
badblocks.c
bfq-cgroup.c
bfq-iosched.c block, bfq: deschedule empty bfq_queues not referred by any process 2019-11-14 07:00:54 -07:00
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c
bio.c fs: move guard_bio_eod() after bio_set_op_attrs 2020-01-17 19:48:21 +01:00
blk-cgroup.c blkcg: make blkcg_print_stat() print stats only for online blkgs 2019-11-06 17:08:38 -07:00
blk-core.c block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT 2020-01-12 12:21:37 +01:00
blk-exec.c
blk-flush.c block: Fix a lockdep complaint triggered by request queue flushing 2020-01-12 12:21:42 +01:00
blk-integrity.c
blk-ioc.c
blk-iocost.c iocost: over-budget forced IOs should schedule async delay 2019-12-31 16:46:19 +01:00
blk-iolatency.c
blk-lib.c
blk-map.c block: fix memleak when __blk_rq_map_user_iov() is failed 2020-01-12 12:21:43 +01:00
blk-merge.c
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: make sure that line break can be printed 2019-12-17 19:56:53 +01:00
blk-mq-tag.c
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c blk-mq: apply normal plugging for HDD 2019-09-27 11:40:21 -06:00
blk-mq.h
blk-pm.c
blk-pm.h
blk-rq-qos.c blk-wbt: fix performance regression in wbt scale_up/scale_down 2019-10-06 09:26:41 -06:00
blk-rq-qos.h blk-rq-qos: fix first node deletion of rq_qos_del() 2019-10-15 10:13:13 -06:00
blk-settings.c block: fix an integer overflow in logical block size 2020-01-23 08:22:32 +01:00
blk-softirq.c
blk-stat.c
blk-stat.h
blk-sysfs.c rq-qos: get rid of redundant wbt_update_limits() 2019-09-27 01:13:10 -06:00
blk-throttle.c
blk-timeout.c
blk-wbt.c blk-wbt: fix performance regression in wbt scale_up/scale_down 2019-10-06 09:26:41 -06:00
blk-wbt.h
blk-zoned.c
blk.h block: Fix a lockdep complaint triggered by request queue flushing 2020-01-12 12:21:42 +01:00
bounce.c
bsg-lib.c
bsg.c
cmdline-parser.c
compat_ioctl.c compat_ioctl: block: handle BLKGETZONESZ/BLKGETNRZONES 2020-01-09 10:19:58 +01:00
elevator.c block: Fix elv_support_iosched() 2019-10-14 13:54:09 -06:00
genhd.c
ioctl.c
ioprio.c
kyber-iosched.c
mq-deadline.c
opal_proto.h
partition-generic.c
scsi_ioctl.c
sed-opal.c block: sed-opal: fix sparse warning: convert __be64 data 2019-10-03 14:21:32 -06:00
t10-pi.c