mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 20:40:25 +03:00
[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>
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user