Skip to content

Commit 07c3e19

Browse files
committed
x86/elf: Make loading of 32bit processes depend on ia32_enabled()
jira VULN-764 cve-pre CVE-2024-25743 cve-pre CVE-2024-25744 commit-author Nikolay Borisov <nik.borisov@suse.com> commit 5ae2702 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 (cherry picked from commit 5ae2702) Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
1 parent 67aceec commit 07c3e19

File tree

1 file changed

+2
-1
lines changed
  • arch/x86/include/asm

1 file changed

+2
-1
lines changed

arch/x86/include/asm/elf.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
#include <linux/thread_info.h>
99

10+
#include <asm/ia32.h>
1011
#include <asm/ptrace.h>
1112
#include <asm/user.h>
1213
#include <asm/auxvec.h>
@@ -160,7 +161,7 @@ do { \
160161
((x)->e_machine == EM_X86_64)
161162

162163
#define compat_elf_check_arch(x) \
163-
(elf_check_arch_ia32(x) || \
164+
((elf_check_arch_ia32(x) && ia32_enabled()) || \
164165
(IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
165166

166167
#if __USER32_DS != __USER_DS

0 commit comments

Comments
 (0)