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

[xen stable-4.16] xen/ELF: Fix ELF32 PRI formatters



commit 7f2df63f723478dee629b5884cdee9914f88d98c
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Apr 24 13:06:28 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Apr 24 13:06:28 2023 +0200

    xen/ELF: Fix ELF32 PRI formatters
    
    It is rude to hide width formatting inside a PRI* macro, doubly so when it's
    only in one bitness of the macro.
    
    However its fully buggy when all the users use %#"PRI because then it 
expands
    to the common trap of %#08x which does not do what the author intends.
    
    Switch the 32bit ELF PRI formatters to use plain integer PRI's, just like on
    the 64bit side already.  No practical change.
    
    Fixes: 7597fabca76e ("livepatch: Include sizes when an mismatch occurs")
    Fixes: 380b229634f8 ("xsplice: Implement payload loading")
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
    master commit: cfa2bb82c01f0c656804cedd8f44eb2a99a2b5bc
    master date: 2023-04-19 15:55:29 +0100
---
 xen/include/xen/elfstructs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/elfstructs.h b/xen/include/xen/elfstructs.h
index 616ebf9269..6860aa41c3 100644
--- a/xen/include/xen/elfstructs.h
+++ b/xen/include/xen/elfstructs.h
@@ -561,8 +561,8 @@ typedef struct {
 #endif
 
 #if defined(ELFSIZE) && (ELFSIZE == 32)
-#define PRIxElfAddr    "08x"
-#define PRIuElfWord    "8u"
+#define PRIxElfAddr    PRIx32
+#define PRIuElfWord    PRIu32
 
 #define Elf_Ehdr       Elf32_Ehdr
 #define Elf_Phdr       Elf32_Phdr
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.16



 


Rackspace

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