URL: <http://savannah.gnu.org/bugs/?38773>
Summary: Loading ELF image via multiboot2 fails Project: GNU GRUB Submitted by: eyak Submitted on: Fri 19 Apr 2013 04:19:35 AM GMT Category: Booting Severity: Major Priority: 5 - Normal Item Group: Software Error Status: None Privacy: Public Assigned to: None Originator Name: Originator Email: Open/Closed: Open Discussion Lock: Any Release: Release: other Reproducibility: Every Time Planned Release: None _______________________________________________________ Details: Hello, I use multiboot2 feature to load ELF image and found a bug in GRUB2 version 1.99. In the ELF multiboot2 header I use both MULTIBOOT_HEADER_TAG_ADDRESS and MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS options. The problem is with cleaning BSS section. The original code in grub_multiboot_load() function in multiboot_mbi2.c makes grub_uint32_t* cast instead of grub_uint8_t*(as for multiboot booting). In the final result the base address of cleaned memory is source + 4*load_size, because of this casting. So the code: ------------- if (addr_tag->bss_end_addr) grub_memset ((grub_uint32_t *) source + load_size, 0, addr_tag->bss_end_addr - addr_tag->load_addr - load_size); ------------- should be replaced with: ------------- if (addr_tag->bss_end_addr) grub_memset ((grub_uint8_t *) source + load_size, 0, addr_tag->bss_end_addr - addr_tag->load_addr - load_size); ------------- In the final result the ELF image loading may hang the board depends on BSS section size as in my case. Regards Leon _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?38773> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-grub mailing list Bug-grub@gnu.org https://lists.gnu.org/mailman/listinfo/bug-grub