prepare process: add magic header in program_load_desc

Check we mapped the correct region with a magic header in the struct

Original commit: d246b93a3bced92d0ac2a4a337118091b010658a

Fujitsu: POSTK_DEBUG_TEMP_FIX_76
Change-Id: If848be64af5d76844ba65b48493021637c8114f4
This commit is contained in:
Dominique Martinet
2019-01-28 17:09:24 +09:00
parent 0cc3120a01
commit 960a6f5f90
4 changed files with 14 additions and 0 deletions

View File

@@ -441,6 +441,13 @@ static int process_msg_prepare_process(unsigned long rphys)
return -ENOMEM;
}
if (p->magic != PLD_MAGIC) {
kprintf("%s: broken mcexec program_load_desc\n", __func__);
ihk_mc_unmap_virtual(p, npages);
ihk_mc_unmap_memory(NULL, phys, sz);
return -EFAULT;
}
n = p->num_sections;
if (n > 16 || 0 >= n) {
kprintf("%s: ERROR: ELF sections other than 1 to 16 ??\n",