linux-stable/block/partitions
Mauricio Faria de Oliveira a4b41559e5 partitions/aix: fix usage of uninitialized lv_info and lvname structures
[ Upstream commit 14cb2c8a6c ]

The if-block that sets a successful return value in aix_partition()
uses 'lvip[].pps_per_lv' and 'n[].name' potentially uninitialized.

For example, if 'numlvs' is zero or alloc_lvn() fails, neither is
initialized, but are used anyway if alloc_pvd() succeeds after it.

So, make the alloc_pvd() call conditional on their initialization.

This has been hit when attaching an apparently corrupted/stressed
AIX LUN, misleading the kernel to pr_warn() invalid data and hang.

    [...] partition (null) (11 pp's found) is not contiguous
    [...] partition (null) (2 pp's found) is not contiguous
    [...] partition (null) (3 pp's found) is not contiguous
    [...] partition (null) (64 pp's found) is not contiguous

Fixes: 6ceea22bbb ("partitions: add aix lvm partition support files")
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-19 22:47:15 +02:00
..
Kconfig block: change config option name for cmdline partition parsing 2013-09-30 14:31:02 -07:00
Makefile block: support embedded device command line partition 2013-09-11 15:56:57 -07:00
acorn.c
acorn.h
aix.c partitions/aix: fix usage of uninitialized lv_info and lvname structures 2018-09-19 22:47:15 +02:00
aix.h partitions: add aix lvm partition support files 2013-07-09 10:33:28 -07:00
amiga.c block/partitions/amiga.c: replace nolevel printk by pr_err 2014-07-01 10:40:02 -06:00
amiga.h
atari.c block: atari: Return early for unsupported sector size 2016-07-13 09:31:44 -07:00
atari.h block: Use macros from compiler.h instead of __attribute__((...)) 2014-02-18 12:20:01 -08:00
check.c block: Remove annoying "unknown partition table" message 2015-01-22 08:03:52 -07:00
check.h block/partitions: optimize memory allocation in check_partition() 2013-02-27 19:10:21 -08:00
cmdline.c block: change config option name for cmdline partition parsing 2013-09-30 14:31:02 -07:00
cmdline.h block: support embedded device command line partition 2013-09-11 15:56:57 -07:00
efi.c partitions/efi: Fix integer overflow in GPT size calculation 2017-10-08 10:26:06 +02:00
efi.h block: Use macros from compiler.h instead of __attribute__((...)) 2014-02-18 12:20:01 -08:00
ibm.c s390/partitions: make partition detection independent from DASD ioctls 2012-09-26 15:45:05 +02:00
ibm.h
karma.c block: Use macros from compiler.h instead of __attribute__((...)) 2014-02-18 12:20:01 -08:00
karma.h
ldm.c block/partitions/ldm.c: use generic UUID library 2016-05-20 17:58:30 -07:00
ldm.h
mac.c mac: validate mac_partition is within sector 2015-11-20 08:49:28 -07:00
mac.h
msdos.c partitions/msdos: Unable to mount UFS 44bsd partitions 2018-04-08 12:12:42 +02:00
msdos.h
osf.c
osf.h
sgi.c
sgi.h
sun.c
sun.h
sysv68.c
sysv68.h
ultrix.c
ultrix.h