[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #38773] Loading ELF image via multiboot2 fails
From: |
Leon Drugi |
Subject: |
[bug #38773] Loading ELF image via multiboot2 fails |
Date: |
Fri, 19 Apr 2013 04:19:36 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31 |
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 #38773] Loading ELF image via multiboot2 fails,
Leon Drugi <=