[PATCH 2/4] arm64/process: Make loading of 32bit processes depend on aarch32_enabled()

From: Andrea della Porta
Date: Wed Oct 18 2023 - 07:13:38 EST


Major aspect of Aarch32 emulation is the ability to load 32bit
processes.
That's currently decided (among others) by compat_elf_check_arch().

Make the macro use aarch32_enabled() to decide if Aarch32 compat is
enabled before loading a 32bit process.

Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
---
arch/arm64/kernel/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 657ea273c0f9..96832f1ec3ee 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -601,7 +601,7 @@ unsigned long arch_align_stack(unsigned long sp)
#ifdef CONFIG_COMPAT
int compat_elf_check_arch(const struct elf32_hdr *hdr)
{
- if (!system_supports_32bit_el0())
+ if (!system_supports_32bit_el0() || !aarch32_enabled())
return false;

if ((hdr)->e_machine != EM_ARM)
--
2.35.3