mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump/dfi_vmcoreinfo: Fix illegal memory access in dfi_vmcoreinfo_init()
Before reading data in dfi_vmcoreinfo_init(), check 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 0x10 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
1d2316caef
commit
957e612720
@@ -90,7 +90,8 @@ void dfi_vmcoreinfo_init(void)
|
||||
addr = l.os_info->vmcoreinfo_addr;
|
||||
size = l.os_info->vmcoreinfo_size;
|
||||
} else {
|
||||
dfi_mem_read(LC_VMCORE_INFO, &addr, sizeof(addr));
|
||||
if (dfi_mem_read_rc(LC_VMCORE_INFO, &addr, sizeof(addr)))
|
||||
return;
|
||||
if (addr == 0)
|
||||
return;
|
||||
if (dfi_mem_read_rc(addr, ¬e, sizeof(note)))
|
||||
|
||||
Reference in New Issue
Block a user