Skip to content

Commit

Permalink
x86/elf: Make loading of 32bit processes depend on ia32_enabled()
Browse files Browse the repository at this point in the history
Major aspect of ia32 emulation is the ability to load 32bit processes.
That's currently decided (among others) by compat_elf_check_arch().

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

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230623111409.3047467-5-nik.borisov@suse.com
  • Loading branch information
Nikolay Borisov authored and Thomas Gleixner committed Sep 14, 2023
1 parent 370dcd5 commit 5ae2702
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
#include <linux/thread_info.h>

#include <asm/ia32.h>
#include <asm/ptrace.h>
#include <asm/user.h>
#include <asm/auxvec.h>
Expand Down Expand Up @@ -149,7 +150,7 @@ do { \
((x)->e_machine == EM_X86_64)

#define compat_elf_check_arch(x) \
(elf_check_arch_ia32(x) || \
((elf_check_arch_ia32(x) && ia32_enabled()) || \
(IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))

static inline void elf_common_init(struct thread_struct *t,
Expand Down

0 comments on commit 5ae2702

Please sign in to comment.