mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl/boot: fix memory use after free in stage2
Prevent access to freed memory still pointed to by entry. entry still points into load_page that has been released with free_page. Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
75675ec627
commit
2dca5d193f
@@ -90,6 +90,7 @@ void start(void)
|
||||
void *load_address;
|
||||
struct component_entry *entry;
|
||||
disk_blockptr_t *blockptr;
|
||||
uint64_t load_psw;
|
||||
void *load_page;
|
||||
int config_nr;
|
||||
|
||||
@@ -133,11 +134,13 @@ void start(void)
|
||||
if (entry->type != COMPONENT_EXECUTE)
|
||||
panic(EWRONGTYPE, "");
|
||||
|
||||
load_psw = entry->address.load_psw;
|
||||
|
||||
free_page((unsigned long)load_page);
|
||||
io_irq_disable();
|
||||
set_device(subchannel_id, DISABLED);
|
||||
|
||||
execute(entry->address.load_psw);
|
||||
execute(load_psw);
|
||||
}
|
||||
|
||||
void panic_notify(unsigned long UNUSED(reason))
|
||||
|
||||
Reference in New Issue
Block a user