Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Replace macro "ARCH_HAVE_EXTRA_ELF_NOTES" with kconfig

"ARCH_HAVE_EXTRA_ELF_NOTES" enables an extra note section in the
core dump. Kconfig variable is preferred over ARCH_HAVE_* macro.

Co-developed-by: Jini Susan George <jinisusan.george@amd.com>
Signed-off-by: Jini Susan George <jinisusan.george@amd.com>
Signed-off-by: Vignesh Balasubramanian <vigbalas@amd.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20240412062138.1132841-2-vigbalas@amd.com
Signed-off-by: Kees Cook <keescook@chromium.org>

authored by

Vignesh Balasubramanian and committed by
Kees Cook
a9c3475d c8238994

+11 -3
+9
arch/Kconfig
··· 502 502 config ARCH_HAVE_NMI_SAFE_CMPXCHG 503 503 bool 504 504 505 + config ARCH_HAVE_EXTRA_ELF_NOTES 506 + bool 507 + help 508 + An architecture should select this in order to enable adding an 509 + arch-specific ELF note section to core files. It must provide two 510 + functions: elf_coredump_extra_notes_size() and 511 + elf_coredump_extra_notes_write() which are invoked by the ELF core 512 + dumper. 513 + 505 514 config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS 506 515 bool 507 516
+1
arch/powerpc/Kconfig
··· 156 156 select ARCH_HAS_UACCESS_FLUSHCACHE 157 157 select ARCH_HAS_UBSAN 158 158 select ARCH_HAVE_NMI_SAFE_CMPXCHG 159 + select ARCH_HAVE_EXTRA_ELF_NOTES if SPU_BASE 159 160 select ARCH_KEEP_MEMBLOCK 160 161 select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if PPC_RADIX_MMU 161 162 select ARCH_MIGHT_HAVE_PC_PARPORT
-2
arch/powerpc/include/asm/elf.h
··· 127 127 /* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */ 128 128 #define NT_SPU 1 129 129 130 - #define ARCH_HAVE_EXTRA_ELF_NOTES 131 - 132 130 #endif /* CONFIG_SPU_BASE */ 133 131 134 132 #ifdef CONFIG_PPC64
+1 -1
include/linux/elf.h
··· 65 65 struct file; 66 66 struct coredump_params; 67 67 68 - #ifndef ARCH_HAVE_EXTRA_ELF_NOTES 68 + #ifndef CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES 69 69 static inline int elf_coredump_extra_notes_size(void) { return 0; } 70 70 static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; } 71 71 #else