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)

Submitter:  Sergio Gelato <gelato>
Submitted:  Mon 06 Feb 2017 08:56:23 AM UTC
   
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  other
Release:  Reproducibility:  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>
Group 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>

 

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

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-09 arvidjaar Planned ReleaseNone 2.03+

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code