diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-07-29 14:09:34 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-07-29 14:17:09 +0100 |
commit | ae7f22eb28dbfdd0e4743a2d9e7aa33344a07246 (patch) | |
tree | 213c19acfa06f5091360a4a12272e928eebf27c4 /src/include/ipxe/elf.h | |
parent | 1e4ff872be639e93e8df3918a965bb08675dcc77 (diff) | |
download | ipxe-ae7f22eb28dbfdd0e4743a2d9e7aa33344a07246.tar.gz |
[elf] Reject ELFBoot images requiring virtual addressing
We do not set up any kind of virtual addressing before invoking an
ELFBoot image. Reject if the image's program headers indicate that
virtual addresses are not equal to physical addresses.
This avoids problems when loading some RHEL5 kernels, which seem to
include ELFBoot headers using virtual addressing. With this change,
these kernels are no longer detected as ELFBoot, and so may be
(correctly) detected as bzImage instead.
Reported-by: Torgeir.Wulfsberg@kongsberg.com
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/elf.h')
-rw-r--r-- | src/include/ipxe/elf.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/ipxe/elf.h b/src/include/ipxe/elf.h index e83a0cf12..033c3f7a8 100644 --- a/src/include/ipxe/elf.h +++ b/src/include/ipxe/elf.h @@ -10,8 +10,19 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +#include <stdint.h> +#include <ipxe/image.h> #include <elf.h> +typedef Elf32_Ehdr Elf_Ehdr; +typedef Elf32_Phdr Elf_Phdr; +typedef Elf32_Off Elf_Off; +#define ELFCLASS ELFCLASS32 + +extern int elf_segments ( struct image *image, Elf_Ehdr *ehdr, + int ( * process ) ( struct image *image, + Elf_Phdr *phdr, physaddr_t dest ), + physaddr_t *entry, physaddr_t *max ); extern int elf_load ( struct image *image, physaddr_t *entry, physaddr_t *max ); #endif /* _IPXE_ELF_H */ |