linux/block/partitions
Mauricio Faria de Oliveira a169d7c844 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:48:59 +02:00
..
acorn.c
acorn.h
aix.c partitions/aix: fix usage of uninitialized lv_info and lvname structures 2018-09-19 22:48:59 +02:00
aix.h
amiga.c
amiga.h
atari.c
atari.h
check.c
check.h
cmdline.c
cmdline.h
efi.c partitions/efi: Fix integer overflow in GPT size calculation 2017-10-08 10:14:18 +02:00
efi.h
ibm.c
ibm.h
karma.c
karma.h
Kconfig
ldm.c
ldm.h
mac.c mac: validate mac_partition is within sector 2015-11-20 08:49:28 -07:00
mac.h
Makefile
msdos.c partitions/msdos: Unable to mount UFS 44bsd partitions 2018-04-08 11:51:56 +02:00
msdos.h
osf.c
osf.h
sgi.c
sgi.h
sun.c
sun.h
sysv68.c
sysv68.h
ultrix.c
ultrix.h