elfcore: Replace CONFIG_{IA64, UML} checks with a new option
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 31 Jan 2022 16:54:52 +0000 (16:54 +0000)
committerWill Deacon <will@kernel.org>
Tue, 15 Feb 2022 22:53:28 +0000 (22:53 +0000)
As arm64 is about to introduce MTE-specific phdrs in the core dump, add
a common CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS option currently selectable
by UML_X86 and IA64.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Link: https://lore.kernel.org/r/20220131165456.2160675-2-catalin.marinas@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/ia64/Kconfig
arch/x86/um/Kconfig
fs/Kconfig.binfmt
include/linux/elfcore.h

index a7e01573abd831c89f065a1ad522ecddab9a9af0..e003b2473c64dfd48fc4f01272f68a7f75c01602 100644 (file)
@@ -8,6 +8,7 @@ menu "Processor type and features"
 
 config IA64
        bool
+       select ARCH_BINFMT_ELF_EXTRA_PHDRS
        select ARCH_HAS_DMA_MARK_CLEAN
        select ARCH_HAS_STRNCPY_FROM_USER
        select ARCH_HAS_STRNLEN_USER
index 40d6a06e41c81b7b9b2328d1526ad8a84676c1d8..ead7e5b3a97573defc132f412bbacc5090dcb1ee 100644 (file)
@@ -8,6 +8,7 @@ endmenu
 
 config UML_X86
        def_bool y
+       select ARCH_BINFMT_ELF_EXTRA_PHDRS if X86_32
 
 config 64BIT
        bool "64-bit kernel" if "$(SUBARCH)" = "x86"
index 4d5ae61580aae336658beefe05bc1d7e15994582..68e5862837649600c3a9fdf46e8b9a339bc15a85 100644 (file)
@@ -36,6 +36,9 @@ config COMPAT_BINFMT_ELF
 config ARCH_BINFMT_ELF_STATE
        bool
 
+config ARCH_BINFMT_ELF_EXTRA_PHDRS
+       bool
+
 config ARCH_HAVE_ELF_PROT
        bool
 
index 746e081879a5ab418ff3b2239c33078135555971..f8e206e82476c30f067ac96f0ca4036dc693638c 100644 (file)
@@ -114,7 +114,7 @@ static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_reg
 #endif
 }
 
-#if (defined(CONFIG_UML) && defined(CONFIG_X86_32)) || defined(CONFIG_IA64)
+#ifdef CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS
 /*
  * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
  * extra segments containing the gate DSO contents.  Dumping its
@@ -149,6 +149,6 @@ static inline size_t elf_core_extra_data_size(void)
 {
        return 0;
 }
-#endif
+#endif /* CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS */
 
 #endif /* _LINUX_ELFCORE_H */