ELF: Properly redefine PT_GNU_* in terms of PT_LOOS
authorKees Cook <keescook@chromium.org>
Thu, 24 Feb 2022 03:34:31 +0000 (19:34 -0800)
committerKees Cook <keescook@chromium.org>
Wed, 2 Mar 2022 00:16:28 +0000 (16:16 -0800)
The PT_GNU_* program header types are actually offsets from PT_LOOS,
so redefine them as such, reorder them, and add the missing PT_GNU_RELRO.

Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
include/uapi/linux/elf.h

index 61bf4774b8f2a13c6517c8df8f1db7717cfa79f5..6438d55529bf82fbf5efeaa908c9995c54f5c30a 100644 (file)
@@ -35,10 +35,11 @@ typedef __s64       Elf64_Sxword;
 #define PT_HIOS    0x6fffffff      /* OS-specific */
 #define PT_LOPROC  0x70000000
 #define PT_HIPROC  0x7fffffff
-#define PT_GNU_EH_FRAME                0x6474e550
-#define PT_GNU_PROPERTY                0x6474e553
-
+#define PT_GNU_EH_FRAME        (PT_LOOS + 0x474e550)
 #define PT_GNU_STACK   (PT_LOOS + 0x474e551)
+#define PT_GNU_RELRO   (PT_LOOS + 0x474e552)
+#define PT_GNU_PROPERTY        (PT_LOOS + 0x474e553)
+
 
 /*
  * Extended Numbering