mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump/dfi: Fix potential illegal memory access in kdump_init()
Before reading data at addresses 0x10418 and 0x10420 in kdump_init(), validate the validity of the memory range. Otherwise this can result in a segmentation fault when zgetdump is given a very small dump, e.g. S390 DASD single-volume dump of size 0x1000 bytes. Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
686c331b69
commit
64539853ca
@@ -1074,6 +1074,10 @@ static void kdump_init(void)
|
||||
{
|
||||
unsigned long base, size;
|
||||
|
||||
if (!dfi_mem_range_valid(0x10418, sizeof(base)))
|
||||
return;
|
||||
if (!dfi_mem_range_valid(0x10420, sizeof(size)))
|
||||
return;
|
||||
dfi_mem_phys_read(0x10418, &base, sizeof(base));
|
||||
dfi_mem_phys_read(0x10420, &size, sizeof(size));
|
||||
if (base == 0 || size == 0)
|
||||
|
||||
Reference in New Issue
Block a user