summaryrefslogtreecommitdiffstats
path: root/fs/compat_binfmt_elf.c
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@collabora.com>2020-10-04 05:25:33 +0200
committerThomas Gleixner <tglx@linutronix.de>2020-10-26 13:46:47 +0100
commit9a29a671902c2be05d636045a4dd365219ca716c (patch)
tree3c9d6f15e1bb6619211073a8cde72cb0d8aeb6b2 /fs/compat_binfmt_elf.c
parentx86/elf: Use e_machine to select start_thread for x32 (diff)
downloadlinux-9a29a671902c2be05d636045a4dd365219ca716c.tar.xz
linux-9a29a671902c2be05d636045a4dd365219ca716c.zip
elf: Expose ELF header on arch_setup_additional_pages()
Like it is done for SET_PERSONALITY with ARM, which requires the ELF header to select correct personality parameters, x86 requires the headers when selecting which VDSO to load, instead of relying on the going-away TIF_IA32/X32 flags. Add an indirection macro to arch_setup_additional_pages(), that x86 can reimplement to receive the extra parameter just for ELF files. This requires no changes to other architectures, who can continue to use the original arch_setup_additional_pages for ELF and non-ELF binaries. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201004032536.1229030-8-krisman@collabora.com
Diffstat (limited to 'fs/compat_binfmt_elf.c')
-rw-r--r--fs/compat_binfmt_elf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c
index 12b991368f0a..2c557229696a 100644
--- a/fs/compat_binfmt_elf.c
+++ b/fs/compat_binfmt_elf.c
@@ -115,11 +115,16 @@
#define START_THREAD COMPAT_START_THREAD
#endif
-#ifdef compat_arch_setup_additional_pages
+#ifdef compat_arch_setup_additional_pages
+#define COMPAT_ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \
+ compat_arch_setup_additional_pages(bprm, interpreter)
+#endif
+
+#ifdef COMPAT_ARCH_SETUP_ADDITIONAL_PAGES
#undef ARCH_HAS_SETUP_ADDITIONAL_PAGES
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
-#undef arch_setup_additional_pages
-#define arch_setup_additional_pages compat_arch_setup_additional_pages
+#undef ARCH_SETUP_ADDITIONAL_PAGES
+#define ARCH_SETUP_ADDITIONAL_PAGES COMPAT_ARCH_SETUP_ADDITIONAL_PAGES
#endif
#ifdef compat_elf_read_implies_exec