History

Merge tag 'execve-v6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull execve updates from Kees Cook: - elf: Define and use note name macros (Akihiko Odaki) - elf: add remaining SHF_ flag macros (Timur Tabi) - binfmt: Remove loader from linux_binprm struct (Yonatan Goldschmidt) - binfmt_elf_fdpic: fix variable set but not used warning (sunliming) * tag 'execve-v6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_elf_fdpic: fix variable set but not used warning elf: add remaining SHF_ flag macros binfmt: Remove loader from linux_binprm struct crash: Remove KEXEC_CORE_NOTE_NAME s390/crash: Use note name macros crash: Use note name macros powerpc/crash: Use note name macros binfmt_elf: Use note name macros elf: Define note name macros

Linus Torvalds committed 1 year ago

Commit 4f773fc2 parents b0cb56c 8d68cab12 files · +148 −80Browse files

Showing the changes to include/uapi/linux (1 of 12 files). Show all

Unified · Split

include/uapi/linux/elf.h+94−5
@@ -291,8 +291,18 @@ typedef struct elf64_phdr { · 290 unmodified lines
291291 #define SHF_WRITE 0x1
292292 #define SHF_ALLOC 0x2
293293 #define SHF_EXECINSTR 0x4
294+#define SHF_MERGE 0x10
295+#define SHF_STRINGS 0x20
296+#define SHF_INFO_LINK 0x40
297+#define SHF_LINK_ORDER 0x80
298+#define SHF_OS_NONCONFORMING 0x100
299+#define SHF_GROUP 0x200
300+#define SHF_TLS 0x400
294301 #define SHF_RELA_LIVEPATCH 0x00100000
295302 #define SHF_RO_AFTER_INIT 0x00200000
303+#define SHF_ORDERED 0x04000000
304+#define SHF_EXCLUDE 0x08000000
305+#define SHF_MASKOS 0x0ff00000
296306 #define SHF_MASKPROC 0xf0000000
297307
298308 /* special section indexes */
@@ -368,101 +378,180 @@ typedef struct elf64_shdr { · 69 unmodified lines
368378 #define ELF_OSABI ELFOSABI_NONE
369379 #endif
370380
381+/* Note definitions: NN_ defines names. NT_ defines types. */
382+
383+#define NN_GNU_PROPERTY_TYPE_0 "GNU"
384+#define NT_GNU_PROPERTY_TYPE_0 5
385+
371386 /*
372387 * Notes used in ET_CORE. Architectures export some of the arch register sets
373388 * using the corresponding note types via the PTRACE_GETREGSET and
374389 * PTRACE_SETREGSET requests.
375− * The note name for these types is "LINUX", except NT_PRFPREG that is named
376− * "CORE".
377390 */
391+#define NN_PRSTATUS "CORE"
378392 #define NT_PRSTATUS 1
393+#define NN_PRFPREG "CORE"
379394 #define NT_PRFPREG 2
395+#define NN_PRPSINFO "CORE"
380396 #define NT_PRPSINFO 3
397+#define NN_TASKSTRUCT "CORE"
381398 #define NT_TASKSTRUCT 4
399+#define NN_AUXV "CORE"
382400 #define NT_AUXV 6
383401 /*
384402 * Note to userspace developers: size of NT_SIGINFO note may increase
385403 * in the future to accomodate more fields, don't assume it is fixed!
386404 */
405+#define NN_SIGINFO "CORE"
387406 #define NT_SIGINFO 0x53494749
407+#define NN_FILE "CORE"
388408 #define NT_FILE 0x46494c45
409+#define NN_PRXFPREG "LINUX"
389410 #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
411+#define NN_PPC_VMX "LINUX"
390412 #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
413+#define NN_PPC_SPE "LINUX"
391414 #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
415+#define NN_PPC_VSX "LINUX"
392416 #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
417+#define NN_PPC_TAR "LINUX"
393418 #define NT_PPC_TAR 0x103 /* Target Address Register */
419+#define NN_PPC_PPR "LINUX"
394420 #define NT_PPC_PPR 0x104 /* Program Priority Register */
421+#define NN_PPC_DSCR "LINUX"
395422 #define NT_PPC_DSCR 0x105 /* Data Stream Control Register */
423+#define NN_PPC_EBB "LINUX"
396424 #define NT_PPC_EBB 0x106 /* Event Based Branch Registers */
425+#define NN_PPC_PMU "LINUX"
397426 #define NT_PPC_PMU 0x107 /* Performance Monitor Registers */
427+#define NN_PPC_TM_CGPR "LINUX"
398428 #define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */
429+#define NN_PPC_TM_CFPR "LINUX"
399430 #define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */
431+#define NN_PPC_TM_CVMX "LINUX"
400432 #define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */
433+#define NN_PPC_TM_CVSX "LINUX"
401434 #define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */
435+#define NN_PPC_TM_SPR "LINUX"
402436 #define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
437+#define NN_PPC_TM_CTAR "LINUX"
403438 #define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */
439+#define NN_PPC_TM_CPPR "LINUX"
404440 #define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */
441+#define NN_PPC_TM_CDSCR "LINUX"
405442 #define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */
443+#define NN_PPC_PKEY "LINUX"
406444 #define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers */
445+#define NN_PPC_DEXCR "LINUX"
407446 #define NT_PPC_DEXCR 0x111 /* PowerPC DEXCR registers */
447+#define NN_PPC_HASHKEYR "LINUX"
408448 #define NT_PPC_HASHKEYR 0x112 /* PowerPC HASHKEYR register */
449+#define NN_386_TLS "LINUX"
409450 #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
451+#define NN_386_IOPERM "LINUX"
410452 #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
453+#define NN_X86_XSTATE "LINUX"
411454 #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
412455 /* Old binutils treats 0x203 as a CET state */
456+#define NN_X86_SHSTK "LINUX"
413457 #define NT_X86_SHSTK 0x204 /* x86 SHSTK state */
458+#define NN_X86_XSAVE_LAYOUT "LINUX"
414459 #define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description */
460+#define NN_S390_HIGH_GPRS "LINUX"
415461 #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
462+#define NN_S390_TIMER "LINUX"
416463 #define NT_S390_TIMER 0x301 /* s390 timer register */
464+#define NN_S390_TODCMP "LINUX"
417465 #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
466+#define NN_S390_TODPREG "LINUX"
418467 #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
468+#define NN_S390_CTRS "LINUX"
419469 #define NT_S390_CTRS 0x304 /* s390 control registers */
470+#define NN_S390_PREFIX "LINUX"
420471 #define NT_S390_PREFIX 0x305 /* s390 prefix register */
472+#define NN_S390_LAST_BREAK "LINUX"
421473 #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
474+#define NN_S390_SYSTEM_CALL "LINUX"
422475 #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
476+#define NN_S390_TDB "LINUX"
423477 #define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
478+#define NN_S390_VXRS_LOW "LINUX"
424479 #define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 upper half */
480+#define NN_S390_VXRS_HIGH "LINUX"
425481 #define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31 */
482+#define NN_S390_GS_CB "LINUX"
426483 #define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */
484+#define NN_S390_GS_BC "LINUX"
427485 #define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */
486+#define NN_S390_RI_CB "LINUX"
428487 #define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */
488+#define NN_S390_PV_CPU_DATA "LINUX"
429489 #define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data */
490+#define NN_ARM_VFP "LINUX"
430491 #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
492+#define NN_ARM_TLS "LINUX"
431493 #define NT_ARM_TLS 0x401 /* ARM TLS register */
494+#define NN_ARM_HW_BREAK "LINUX"
432495 #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
496+#define NN_ARM_HW_WATCH "LINUX"
433497 #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
498+#define NN_ARM_SYSTEM_CALL "LINUX"
434499 #define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
500+#define NN_ARM_SVE "LINUX"
435501 #define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */
502+#define NN_ARM_PAC_MASK "LINUX"
436503 #define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks */
504+#define NN_ARM_PACA_KEYS "LINUX"
437505 #define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication address keys */
506+#define NN_ARM_PACG_KEYS "LINUX"
438507 #define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */
508+#define NN_ARM_TAGGED_ADDR_CTRL "LINUX"
439509 #define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */
510+#define NN_ARM_PAC_ENABLED_KEYS "LINUX"
440511 #define NT_ARM_PAC_ENABLED_KEYS 0x40a /* arm64 ptr auth enabled keys (prctl()) */
512+#define NN_ARM_SSVE "LINUX"
441513 #define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers */
514+#define NN_ARM_ZA "LINUX"
442515 #define NT_ARM_ZA 0x40c /* ARM SME ZA registers */
516+#define NN_ARM_ZT "LINUX"
443517 #define NT_ARM_ZT 0x40d /* ARM SME ZT registers */
518+#define NN_ARM_FPMR "LINUX"
444519 #define NT_ARM_FPMR 0x40e /* ARM floating point mode register */
520+#define NN_ARM_POE "LINUX"
445521 #define NT_ARM_POE 0x40f /* ARM POE registers */
522+#define NN_ARM_GCS "LINUX"
446523 #define NT_ARM_GCS 0x410 /* ARM GCS state */
524+#define NN_ARC_V2 "LINUX"
447525 #define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
526+#define NN_VMCOREDD "LINUX"
448527 #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
528+#define NN_MIPS_DSP "LINUX"
449529 #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
530+#define NN_MIPS_FP_MODE "LINUX"
450531 #define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
532+#define NN_MIPS_MSA "LINUX"
451533 #define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
534+#define NN_RISCV_CSR "LINUX"
452535 #define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */
536+#define NN_RISCV_VECTOR "LINUX"
453537 #define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
538+#define NN_RISCV_TAGGED_ADDR_CTRL "LINUX"
454539 #define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged address control (prctl()) */
540+#define NN_LOONGARCH_CPUCFG "LINUX"
455541 #define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */
542+#define NN_LOONGARCH_CSR "LINUX"
456543 #define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */
544+#define NN_LOONGARCH_LSX "LINUX"
457545 #define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */
546+#define NN_LOONGARCH_LASX "LINUX"
458547 #define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced SIMD Extension registers */
548+#define NN_LOONGARCH_LBT "LINUX"
459549 #define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary Translation registers */
550+#define NN_LOONGARCH_HW_BREAK "LINUX"
460551 #define NT_LOONGARCH_HW_BREAK 0xa05 /* LoongArch hardware breakpoint registers */
552+#define NN_LOONGARCH_HW_WATCH "LINUX"
461553 #define NT_LOONGARCH_HW_WATCH 0xa06 /* LoongArch hardware watchpoint registers */
462554
463−/* Note types with note name "GNU" */
464−#define NT_GNU_PROPERTY_TYPE_0 5
465−
466555 /* Note header in a PT_NOTE section */
467556 typedef struct elf32_note {
468557 Elf32_Word n_namesz; /* Name size */