From 60e35759c432e5b5e9962415c2bf54001db33f07 Mon Sep 17 00:00:00 2001 From: Sunderland93 Date: Sat, 15 Jun 2024 00:10:45 +0400 Subject: [PATCH] Refresh patches --- ...make-x32-syscall-support-conditional.patch | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 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 010fa59..4ea43d2 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,23 +29,23 @@ Signed-off-by: Ben Hutchings --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -6172,6 +6172,10 @@ +@@ -5768,6 +5768,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. + - sysrq_always_enabled - [KNL] - Ignore sysrq setting - this boot parameter will + sysfs.deprecated=0|1 [KNL] + Enable/disable old style sysfs layout for old udev + on older distributions. When this option is enabled --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -3058,6 +3058,14 @@ config COMPAT_32 +@@ -2865,6 +2865,14 @@ config COMPAT_32 select HAVE_UID16 select OLD_SIGSUSPEND3 - + +config X86_X32_DISABLED + bool "x32 ABI disabled by default" + depends on X86_X32_ABI @@ -62,7 +62,7 @@ Signed-off-by: Ben Hutchings @@ -62,7 +62,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); @@ -79,7 +79,7 @@ Signed-off-by: Ben Hutchings +#define MODULE_PARAM_PREFIX "syscall." #include #include - + @@ -16,3 +19,46 @@ asmlinkage const sys_call_ptr_t x32_sys_call_table[] = { #include @@ -136,19 +136,19 @@ Signed-off-by: Ben Hutchings +#ifndef COMPILE_OFFSETS /* avoid a circular dependency on asm-offsets.h */ +#include +#endif - + typedef unsigned long elf_greg_t; - -@@ -150,7 +153,8 @@ do { \ - + +@@ -161,7 +164,8 @@ do { \ + #define compat_elf_check_arch(x) \ (elf_check_arch_ia32(x) || \ - (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64)) + (IS_ENABLED(CONFIG_X86_X32_ABI) && x32_enabled && \ + (x)->e_machine == EM_X86_64)) - - static inline void elf_common_init(struct thread_struct *t, - struct pt_regs *regs, const u16 ds) + + #if __USER32_DS != __USER_DS + # error "The following code assumes __USER32_DS == __USER_DS" --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h @@ -13,6 +13,7 @@ @@ -158,11 +158,11 @@ Signed-off-by: Ben Hutchings +#include #include /* for TS_COMPAT */ #include - + @@ -30,6 +31,18 @@ extern const sys_call_ptr_t ia32_sys_cal extern const sys_call_ptr_t x32_sys_call_table[]; #endif - + +#if defined(CONFIG_X86_X32_ABI) +#if defined(CONFIG_X86_X32_DISABLED) +DECLARE_STATIC_KEY_FALSE(x32_enabled_skey);