bugGNU GRUB - Bugs: bug #50237, Wrong descsz in Xen ELF note 9...

 
 

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

bug #50237: Wrong descsz in Xen ELF note 9 (PAE_MODEL)

Submitted by:  Sergio Gelato <gelato>
Submitted on:  Mon 06 Feb 2017 08:56:23 AM UTC  
 
Category: NoneSeverity: Major
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: otherReproducibility: Every Time
Planned Release: 2.03+

Thu 09 Feb 2017 06:33:47 PM UTC, comment #1:

Yes, this looks wrong, but unless you can provide test case where it breaks, it is post 2.02 cleanup. Looking at note description, it will actually affect only older Xen versions. Otherwise it should simply get "yes" string.

grub-mkimage was created long before xen headers were imported into grub tree.

Feel free to submit cleanup patch to grub-devel. Please split it in to commits (one for "yes,bimodal" and one for using symbolic names.

Andrei Borzenkov <arvidjaar>
Project Member
Mon 06 Feb 2017 08:56:23 AM UTC, original submission:

In util/grub-mkimagexx.c, the code that sets up ELF notes for IMAGE_XEN on EM_386 is not self-consistent: it has

note_ptr->n_descsz = grub_host_to_target32 (sizeof ("yes,bimodal"));

followed by

memcpy (ptr, "yes", sizeof ("yes"));
ptr += ALIGN_UP (sizeof ("yes"), 4);

As a result, the note is shorter than its header implies.

The defined value of XEN_NOTE_SIZE in util/grub-mkimage32.c is consistent with the actual length of the note, so the likelier fix is to change note_ptr->n_descsz to be grub_host_to_target32 (sizeof ("yes")) .

I noticed this by source code inspection while researching bug #46014. Unfortunately, fixing this issue doesn't seem to solve that bug.

(Aside: maybe util/grub-mkimagexx.c should make use of the named symbols defined in include/xen/elfnote.h ?)

Sergio Gelato <gelato>

 

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 arvidjaar (Posted a comment)
  • -unavailable- added by gelato (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 Feb 2017 06:33:47 PM UTCarvidjaarPlanned ReleaseNone=>2.03+

    Back to the top


    Powered by Savane 3.1-cleanup1