diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 097356603e13fa0036f77fff1500e2e1b6de96c0..5699d2fd2be06509a3646a17f3eb3b84196e8fa3 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/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 42bb0fb18c508e719901b671bddc2520fc480209..4c7d6f5d28d59144e213c8230ea0541fbb7a869e 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -990,7 +990,6 @@ CONFIG_FREEZER=y # Executable file formats # CONFIG_BINFMT_ELF=y -CONFIG_COMPAT_BINFMT_ELF=y CONFIG_ARCH_BINFMT_ELF_STATE=y CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y CONFIG_ARCH_HAVE_ELF_PROT=y 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/mips/Kconfig b/arch/mips/Kconfig index bc8421859006fa4a1a57cf5c0bf8ac9ab28c8efe..41626c53f2117b69afa07c42078fdf1145d2dce5 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -3085,6 +3085,7 @@ config MIPS32_O32 select ARCH_WANT_OLD_COMPAT_IPC select COMPAT select MIPS32_COMPAT + select COMPAT_BINFMT_ELF help Select this option if you want to run o32 binaries. These are pure 32-bit binaries as used by the 32-bit Linux/MIPS port. Most of @@ -3097,6 +3098,7 @@ config MIPS32_N32 depends on 64BIT select ARCH_WANT_COMPAT_IPC_PARSE_VERSION select COMPAT + select COMPAT_BINFMT_ELF select MIPS32_COMPAT help Select this option if you want to run n32 binaries. These are diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 68cbe666510a37d9c6c7f2d86fcc2521e443bb02..d8c3e78461c3e49d34f25ceed99fa1f3b7c13b4d 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -348,6 +348,7 @@ source "kernel/Kconfig.hz" config COMPAT def_bool y depends on 64BIT + select COMPAT_BINFMT_ELF if BINFMT_ELF config AUDIT_ARCH def_bool y diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c253be653876b207e22d66f7cc798d8d89178afa..57e0bd90f40e7bbe154c648d6ab70c8bc0c23aef 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -333,6 +333,7 @@ config COMPAT depends on PPC64 depends on !CC_IS_CLANG || CLANG_VERSION >= 120000 default y if !CPU_LITTLE_ENDIAN + select COMPAT_BINFMT_ELF select ARCH_WANT_OLD_COMPAT_IPC select COMPAT_OLD_SIGACTION diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index ae29e4392664ad40236ade2614106fa2127d4a55..ad824ffbb159a8d5f9dcad428a0db3ba7f92a801 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -444,6 +444,7 @@ config COMMAND_LINE_SIZE config COMPAT def_bool y prompt "Kernel support for 31 bit emulation" + select COMPAT_BINFMT_ELF if BINFMT_ELF select ARCH_WANT_OLD_COMPAT_IPC select COMPAT_OLD_SIGACTION select HAVE_UID16 diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 49849790e66dc301ca1f5622e0f67170df105022..1c76156d0968a7eb2ec71da22b038ea9dfc3a66d 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -488,6 +488,7 @@ config COMPAT bool depends on SPARC64 default y + select COMPAT_BINFMT_ELF select HAVE_UID16 select ARCH_WANT_OLD_COMPAT_IPC select COMPAT_OLD_SIGACTION diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 66bfabae8814919c61902da3cdc77a45d9efa775..edc67cf22dc5466cbabe2a9ef430cca0eacd072f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2977,6 +2977,7 @@ config COMPAT_32 config COMPAT def_bool y depends on IA32_EMULATION || X86_X32_ABI + select COMPAT_BINFMT_ELF if BINFMT_ELF config COMPAT_FOR_U64_ALIGNMENT def_bool y diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index f5693164ca9a311e97eed173c73ce27ab740d8cf..2b864f363a36576334192081c5c5c04cb65937bb 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@ -39,7 +39,7 @@ config BINFMT_ELF_KUNIT_TEST compat_binfmt_elf KUnit test is also created. config COMPAT_BINFMT_ELF - def_bool y + bool depends on COMPAT && BINFMT_ELF select ELFCORE