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

 
 

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

bug #38773: Loading ELF image via multiboot2 fails

Submitted by:  Paweł Wojtalczyk <eyak>
Submitted on:  Fri 19 Apr 2013 04:19:35 AM UTC  
 
Category: BootingSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: otherReproducibility: Every Time
Planned Release: None

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

Committed, thanks.

Vladimir Serbinenko <phcoder>
Project 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 + 4load_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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 27 Apr 2013 07:17:59 PM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup