mirror of https://github.com/xemu-project/xemu.git
S390: fix kernel_commandline handling
The current handling of kernel parameters is broken. The pointer is always valid, even if no -kernel or -append is specified. We must check if the kernel rom address is valid instead, otherwise qemu might segfault. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
b754e4fc1e
commit
cc3c7384ac
|
@ -274,7 +274,7 @@ static void s390_init(ram_addr_t my_ram_size,
|
||||||
memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8);
|
memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kernel_cmdline) {
|
if (rom_ptr(KERN_PARM_AREA)) {
|
||||||
/* we have to overwrite values in the kernel image, which are "rom" */
|
/* we have to overwrite values in the kernel image, which are "rom" */
|
||||||
memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline,
|
memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline,
|
||||||
strlen(kernel_cmdline) + 1);
|
strlen(kernel_cmdline) + 1);
|
||||||
|
|
Loading…
Reference in New Issue