Commit a9c3475d authored by Vignesh Balasubramanian's avatar Vignesh Balasubramanian Committed by Kees Cook

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: default avatarJini Susan George <jinisusan.george@amd.com>
Signed-off-by: default avatarJini Susan George <jinisusan.george@amd.com>
Signed-off-by: default avatarVignesh Balasubramanian <vigbalas@amd.com>
Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20240412062138.1132841-2-vigbalas@amd.comSigned-off-by: default avatarKees Cook <keescook@chromium.org>
parent c8238994
...@@ -502,6 +502,15 @@ config MMU_LAZY_TLB_SHOOTDOWN ...@@ -502,6 +502,15 @@ config MMU_LAZY_TLB_SHOOTDOWN
config ARCH_HAVE_NMI_SAFE_CMPXCHG config ARCH_HAVE_NMI_SAFE_CMPXCHG
bool 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 config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
bool bool
......
...@@ -156,6 +156,7 @@ config PPC ...@@ -156,6 +156,7 @@ config PPC
select ARCH_HAS_UACCESS_FLUSHCACHE select ARCH_HAS_UACCESS_FLUSHCACHE
select ARCH_HAS_UBSAN select ARCH_HAS_UBSAN
select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAVE_NMI_SAFE_CMPXCHG
select ARCH_HAVE_EXTRA_ELF_NOTES if SPU_BASE
select ARCH_KEEP_MEMBLOCK select ARCH_KEEP_MEMBLOCK
select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if PPC_RADIX_MMU select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if PPC_RADIX_MMU
select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_PARPORT
......
...@@ -127,8 +127,6 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, ...@@ -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>". */ /* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
#define NT_SPU 1 #define NT_SPU 1
#define ARCH_HAVE_EXTRA_ELF_NOTES
#endif /* CONFIG_SPU_BASE */ #endif /* CONFIG_SPU_BASE */
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
......
...@@ -65,7 +65,7 @@ extern Elf64_Dyn _DYNAMIC []; ...@@ -65,7 +65,7 @@ extern Elf64_Dyn _DYNAMIC [];
struct file; struct file;
struct coredump_params; 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_size(void) { return 0; }
static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; } static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment