]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Replace macro "ARCH_HAVE_EXTRA_ELF_NOTES" with kconfig
authorVignesh Balasubramanian <vigbalas@amd.com>
Fri, 12 Apr 2024 06:21:39 +0000 (11:51 +0530)
committerKees Cook <keescook@chromium.org>
Mon, 15 Apr 2024 18:02:51 +0000 (11:02 -0700)
"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>
arch/Kconfig
arch/powerpc/Kconfig
arch/powerpc/include/asm/elf.h
include/linux/elf.h

index 9f066785bb71d93ca5da01a22d15ed2effba5901..143f021c8a7684c0807cb8ad24f90843e2448e93 100644 (file)
@@ -502,6 +502,15 @@ config MMU_LAZY_TLB_SHOOTDOWN
 config ARCH_HAVE_NMI_SAFE_CMPXCHG
        bool
 
+config ARCH_HAVE_EXTRA_ELF_NOTES
+       bool
+       help
+         An architecture should select this in order to enable adding an
+         arch-specific ELF note section to core files. It must provide two
+         functions: elf_coredump_extra_notes_size() and
+         elf_coredump_extra_notes_write() which are invoked by the ELF core
+         dumper.
+
 config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
        bool
 
index 1c4be337368604a78d0dd901a68f308493e1a021..c45fa9d7fb7695cb4b11d5b75557ba86b81cbbe4 100644 (file)
@@ -156,6 +156,7 @@ config PPC
        select ARCH_HAS_UACCESS_FLUSHCACHE
        select ARCH_HAS_UBSAN
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
+       select ARCH_HAVE_EXTRA_ELF_NOTES        if SPU_BASE
        select ARCH_KEEP_MEMBLOCK
        select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if PPC_RADIX_MMU
        select ARCH_MIGHT_HAVE_PC_PARPORT
index 79f1c480b5eb2fe6e3266c46fe8c232226693ddd..bb4b94444d3e8a9a0e7885f3d81e701a25f9d1f4 100644 (file)
@@ -127,8 +127,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 /* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
 #define NT_SPU         1
 
-#define ARCH_HAVE_EXTRA_ELF_NOTES
-
 #endif /* CONFIG_SPU_BASE */
 
 #ifdef CONFIG_PPC64
index c9a46c4e183bc2a23206d147fd31eaec8bf90b90..5c402788da19e71ba282d02c3f813a384b9a8e90 100644 (file)
@@ -65,7 +65,7 @@ extern Elf64_Dyn _DYNAMIC [];
 struct file;
 struct coredump_params;
 
-#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
+#ifndef CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES
 static inline int elf_coredump_extra_notes_size(void) { return 0; }
 static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; }
 #else