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

[Xen-changelog] [xen master] tools/xcutils/readnotes: adjust print_l1_mfn_valid_note



commit 50421bd56bf164f490d7d0bf5741e58936de41e8
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Fri Jun 14 16:39:36 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Fri Jun 14 16:39:36 2013 +0100

    tools/xcutils/readnotes: adjust print_l1_mfn_valid_note
    
    Use the new PTRVAL macros and elf_access_unsigned in
    print_l1_mfn_valid_note.
    
    No functional change unless the input is wrong, or we are reading a
    file for a different endianness.
    
    Separated out from the previous patch because this change does produce
    a difference in the generated code.
    
    This is part of the fix to a security issue, XSA-55.
    
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Chuck Anderson <chuck.anderson@xxxxxxxxxx>
    
    v2: Split out into its own patch.
---
 tools/xcutils/readnotes.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/xcutils/readnotes.c b/tools/xcutils/readnotes.c
index 2af047d..7ff2530 100644
--- a/tools/xcutils/readnotes.c
+++ b/tools/xcutils/readnotes.c
@@ -77,22 +77,23 @@ static void print_numeric_note(const char *prefix, struct 
elf_binary *elf,
 }
 
 static void print_l1_mfn_valid_note(const char *prefix, struct elf_binary *elf,
-                                   const elf_note *note)
+                                   ELF_HANDLE_DECL(elf_note) note)
 {
        int descsz = elf_uval(elf, note, descsz);
-       const uint32_t *desc32 = elf_note_desc(elf, note);
-       const uint64_t *desc64 = elf_note_desc(elf, note);
+       ELF_PTRVAL_CONST_VOID desc = elf_note_desc(elf, note);
 
        /* XXX should be able to cope with a list of values. */
        switch ( descsz / 2 )
        {
        case 8:
                printf("%s: mask=%#"PRIx64" value=%#"PRIx64"\n", prefix,
-                      desc64[0], desc64[1]);
+                      elf_access_unsigned(elf, desc, 0, 8),
+                      elf_access_unsigned(elf, desc, 8, 8));
                break;
        case 4:
                printf("%s: mask=%#"PRIx32" value=%#"PRIx32"\n", prefix,
-                      desc32[0],desc32[1]);
+                      (uint32_t)elf_access_unsigned(elf, desc, 0, 4),
+                      (uint32_t)elf_access_unsigned(elf, desc, 4, 4));
                break;
        }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.