bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Sergio Gelato
Subject: [bug #50237] Wrong descsz in Xen ELF note 9 (PAE_MODEL)
Date: Mon, 6 Feb 2017 08:56:24 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:51.0) Gecko/20100101 Firefox/51.0

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]