URL:
  <http://savannah.gnu.org/bugs/?50237>

                 Summary: Wrong descsz in Xen ELF note 9 (PAE_MODEL)
                 Project: GNU GRUB
            Submitted by: gelato
            Submitted on: Mon Feb  6 08:56:23 2017
                Category: None
                Severity: Major
                Priority: 5 - Normal
              Item Group: None
                  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:

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 ?)




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50237>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-grub mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to