bugGNU GRUB - Bugs: bug #38773, Loading ELF image via multiboot2...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #38773: Loading ELF image via multiboot2 fails

Submitter:  PaweÅ‚ Wojtalczyk <eyak>
Submitted:  Fri 19 Apr 2013 04:19:35 AM UTC
   
 
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Sat 27 Apr 2013 07:17:59 PM UTC, comment #1: 

Committed, thanks.

Vladimir Serbinenko <phcoder>
Group administrator
Fri 19 Apr 2013 04:19:35 AM UTC, original submission:  

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

Paweł Wojtalczyk <eyak>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by eyak (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-27 phcoder StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code