diff options
Diffstat (limited to 'debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch')
-rw-r--r-- | debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch | 22 |
1 files changed, 11 insertions, 11 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 44dd25261..78f407896 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 @@ -29,7 +29,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk> --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -5768,6 +5768,10 @@ +@@ -6160,6 +6160,10 @@ later by a loaded module cannot be set this way. Example: sysctl.vm.swappiness=40 @@ -42,7 +42,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk> on older distributions. When this option is enabled --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -2865,6 +2865,14 @@ config COMPAT_32 +@@ -2997,6 +2997,14 @@ config COMPAT_32 select HAVE_UID16 select OLD_SIGSUSPEND3 @@ -59,14 +59,14 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk> depends on IA32_EMULATION || X86_X32_ABI --- a/arch/x86/entry/common.c +++ b/arch/x86/entry/common.c -@@ -62,7 +62,7 @@ static __always_inline bool do_syscall_x +@@ -63,7 +63,7 @@ static __always_inline bool do_syscall_x */ unsigned int xnr = nr - __X32_SYSCALL_BIT; - if (IS_ENABLED(CONFIG_X86_X32_ABI) && likely(xnr < X32_NR_syscalls)) { + if (IS_ENABLED(CONFIG_X86_X32_ABI) && unlikely(x32_enabled) && likely(xnr < X32_NR_syscalls)) { xnr = array_index_nospec(xnr, X32_NR_syscalls); - regs->ax = x32_sys_call_table[xnr](regs); + regs->ax = x32_sys_call(regs, xnr); return true; --- a/arch/x86/entry/syscall_x32.c +++ b/arch/x86/entry/syscall_x32.c @@ -80,9 +80,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk> #include <linux/syscalls.h> #include <asm/syscall.h> -@@ -16,3 +19,46 @@ - asmlinkage const sys_call_ptr_t x32_sys_call_table[] = { - #include <asm/syscalls_x32.h> +@@ -20,3 +23,46 @@ long x32_sys_call(const struct pt_regs * + default: return __x64_sys_ni_syscall(regs); + } }; + +/* Maybe enable x32 syscalls */ @@ -139,7 +139,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk> typedef unsigned long elf_greg_t; -@@ -161,7 +164,8 @@ do { \ +@@ -150,7 +153,8 @@ do { \ #define compat_elf_check_arch(x) \ (elf_check_arch_ia32(x) || \ @@ -159,9 +159,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk> #include <asm/thread_info.h> /* for TS_COMPAT */ #include <asm/unistd.h> -@@ -30,6 +31,18 @@ extern const sys_call_ptr_t ia32_sys_cal - extern const sys_call_ptr_t x32_sys_call_table[]; - #endif +@@ -28,6 +29,18 @@ extern long ia32_sys_call(const struct p + extern long x32_sys_call(const struct pt_regs *, unsigned int nr); + extern long x64_sys_call(const struct pt_regs *, unsigned int nr); +#if defined(CONFIG_X86_X32_ABI) +#if defined(CONFIG_X86_X32_DISABLED) |