|
@@ -941,22 +941,8 @@ int kexec_load_purgatory(struct kimage *image, unsigned long min,
|
|
|
if (kexec_purgatory_size <= 0)
|
|
|
return -EINVAL;
|
|
|
|
|
|
- if (kexec_purgatory_size < sizeof(Elf_Ehdr))
|
|
|
- return -ENOEXEC;
|
|
|
-
|
|
|
pi->ehdr = (Elf_Ehdr *)kexec_purgatory;
|
|
|
|
|
|
- if (memcmp(pi->ehdr->e_ident, ELFMAG, SELFMAG) != 0
|
|
|
- || pi->ehdr->e_type != ET_REL
|
|
|
- || !elf_check_arch(pi->ehdr)
|
|
|
- || pi->ehdr->e_shentsize != sizeof(Elf_Shdr))
|
|
|
- return -ENOEXEC;
|
|
|
-
|
|
|
- if (pi->ehdr->e_shoff >= kexec_purgatory_size
|
|
|
- || (pi->ehdr->e_shnum * sizeof(Elf_Shdr) >
|
|
|
- kexec_purgatory_size - pi->ehdr->e_shoff))
|
|
|
- return -ENOEXEC;
|
|
|
-
|
|
|
ret = __kexec_load_purgatory(image, min, max, top_down);
|
|
|
if (ret)
|
|
|
return ret;
|