diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 42079bfdf40ae62f85fc9c84560ae40542a5172a..42f31d37ce234d2031aaaac5cba5df5f1085be1d 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -568,7 +568,7 @@ config ARM64_ERRATUM_834220 config ARM64_ERRATUM_1742098 bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence" - depends on COMPAT + depends on AARCH32_EL0 default y help This option removes the AES hwcap for aarch32 user-space to diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index de3ad90894ecbc9fa0af887a56c11f9f1ce71905..09c21bd448f267d3e2c0c9a246470fc1ddc99a8b 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -203,6 +203,8 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, #endif #ifdef CONFIG_COMPAT +#define EF_ARM_EABI_MASK 0xff000000 +int compat_elf_check_arch(const struct elf32_hdr *); /* PIE load location for compat arm. Must match ARM ELF_ET_DYN_BASE. */ #define COMPAT_ELF_ET_DYN_BASE 0x000400000UL @@ -215,8 +217,6 @@ typedef unsigned int compat_elf_greg_t; typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; /* AArch32 EABI. */ -#define EF_ARM_EABI_MASK 0xff000000 -int compat_elf_check_arch(const struct elf32_hdr *); #define compat_start_thread compat_start_thread #ifdef CONFIG_COMPAT_VDSO @@ -239,6 +239,11 @@ extern int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp); #endif /* CONFIG_AARCH32_EL0 */ +#ifdef CONFIG_ARM64_ILP32 +#undef CONFIG_AARCH32_EL0 +#define compat_elf_gregset_t elf_gregset_t +#endif + struct arch_elf_state { int flags; }; diff --git a/arch/arm64/include/asm/seccomp.h b/arch/arm64/include/asm/seccomp.h index a6be48b9225a664255727391888c742fc0fc1f4a..bc3ab2468f03e0d535a2571b9ac2d53cc7cb73ae 100644 --- a/arch/arm64/include/asm/seccomp.h +++ b/arch/arm64/include/asm/seccomp.h @@ -52,10 +52,10 @@ static inline const int *get_compat_mode1_syscalls(void) #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_AARCH64 #define SECCOMP_ARCH_NATIVE_NR NR_syscalls #define SECCOMP_ARCH_NATIVE_NAME "aarch64" -#ifdef CONFIG_COMPAT +#ifdef CONFIG_AARCH32_EL0 # define SECCOMP_ARCH_COMPAT AUDIT_ARCH_ARM # define SECCOMP_ARCH_COMPAT_NR __NR_compat_syscalls # define SECCOMP_ARCH_COMPAT_NAME "arm" -#endif +#endif /* CONFIG_AARCH32_EL0 */ #endif /* _ASM_SECCOMP_H */ diff --git a/arch/arm64/kernel/binfmt_ilp32.c b/arch/arm64/kernel/binfmt_ilp32.c index 17784c7f116377679a0c8bc17cc543a72d3432e7..c5ce83dc07463930d51e7af173f581076a52b209 100644 --- a/arch/arm64/kernel/binfmt_ilp32.c +++ b/arch/arm64/kernel/binfmt_ilp32.c @@ -3,9 +3,6 @@ /* * Support for ILP32 Linux/aarch64 ELF binaries. */ -#undef CONFIG_AARCH32_EL0 -#define compat_elf_gregset_t elf_gregset_t - #include #include #include diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 489810e3a7a10415a5ce40af55cd18c38f841dcd..1c87f990e7af9a089b4b8058d2c06b9c49d46bbe 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -597,7 +597,7 @@ unsigned long arch_align_stack(unsigned long sp) return sp & ~0xf; } -#ifdef CONFIG_AARCH32_EL0 +#ifdef CONFIG_COMPAT int compat_elf_check_arch(const struct elf32_hdr *hdr) { if (!system_supports_32bit_el0())