From d8ae023995a1af3cef2a20ab88fe1885957c80dc Mon Sep 17 00:00:00 2001 From: Sunderland93 Date: Sat, 15 Jun 2024 00:55:56 +0400 Subject: [PATCH] Refresh x86-make-x32-syscall-support-conditional patch --- ...make-x32-syscall-support-conditional.patch | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch b/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch index 200c19e..2a7938c 100644 --- a/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch +++ b/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch @@ -27,19 +27,9 @@ Signed-off-by: Ben Hutchings arch/x86/include/asm/syscall.h | 13 ++++++ 6 files changed, 78 insertions(+), 2 deletions(-) ---- a/Documentation/admin-guide/kernel-parameters.txt -+++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -6160,6 +6160,10 @@ - later by a loaded module cannot be set this way. - Example: sysctl.vm.swappiness=40 - -+ syscall.x32= [KNL,x86_64] Enable/disable use of x32 syscalls on -+ an x86_64 kernel where CONFIG_X86_X32 is enabled. -+ Default depends on CONFIG_X86_X32_DISABLED. -+ --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -2997,6 +2997,14 @@ config COMPAT_32 +@@ -2987,6 +2987,14 @@ select HAVE_UID16 select OLD_SIGSUSPEND3 @@ -56,7 +46,7 @@ Signed-off-by: Ben Hutchings depends on IA32_EMULATION || X86_X32_ABI --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -63,7 +63,7 @@ static __always_inline bool do_syscall_x +@@ -63,7 +63,7 @@ */ unsigned int xnr = nr - __X32_SYSCALL_BIT; @@ -77,7 +67,7 @@ Signed-off-by: Ben Hutchings #include #include -@@ -20,3 +23,46 @@ long x32_sys_call(const struct pt_regs * +@@ -20,3 +23,46 @@ default: return __x64_sys_ni_syscall(regs); } }; @@ -136,7 +126,7 @@ Signed-off-by: Ben Hutchings typedef unsigned long elf_greg_t; -@@ -150,7 +153,8 @@ do { \ +@@ -150,7 +153,8 @@ #define compat_elf_check_arch(x) \ (elf_check_arch_ia32(x) || \ @@ -144,8 +134,8 @@ Signed-off-by: Ben Hutchings + (IS_ENABLED(CONFIG_X86_X32_ABI) && x32_enabled && \ + (x)->e_machine == EM_X86_64)) - #if __USER32_DS != __USER_DS - # error "The following code assumes __USER32_DS == __USER_DS" + static inline void elf_common_init(struct thread_struct *t, + struct pt_regs *regs, const u16 ds) --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h @@ -13,6 +13,7 @@ @@ -156,7 +146,7 @@ Signed-off-by: Ben Hutchings #include /* for TS_COMPAT */ #include -@@ -28,6 +29,18 @@ extern long ia32_sys_call(const struct p +@@ -28,6 +29,18 @@ extern long x32_sys_call(const struct pt_regs *, unsigned int nr); extern long x64_sys_call(const struct pt_regs *, unsigned int nr);