Refresh patches (again)

This commit is contained in:
Aleksey Samoilov 2024-06-15 00:17:33 +04:00
parent c8c96bb933
commit 3c4687056e
Signed by: Sunderland93
GPG key ID: D3E730685C28F1FB

View file

@ -29,7 +29,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
--- a/Documentation/admin-guide/kernel-parameters.txt --- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -6160,6 +6160,10 @@ @@ -6410,6 +6410,10 @@
later by a loaded module cannot be set this way. later by a loaded module cannot be set this way.
Example: sysctl.vm.swappiness=40 Example: sysctl.vm.swappiness=40
@ -37,12 +37,12 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+ an x86_64 kernel where CONFIG_X86_X32 is enabled. + an x86_64 kernel where CONFIG_X86_X32 is enabled.
+ Default depends on CONFIG_X86_X32_DISABLED. + Default depends on CONFIG_X86_X32_DISABLED.
+ +
sysfs.deprecated=0|1 [KNL] sysrq_always_enabled
Enable/disable old style sysfs layout for old udev [KNL]
on older distributions. When this option is enabled Ignore sysrq setting - this boot parameter will
--- a/arch/x86/Kconfig --- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig +++ b/arch/x86/Kconfig
@@ -2997,6 +2997,14 @@ config COMPAT_32 @@ -3024,6 +3024,14 @@ config COMPAT_32
select HAVE_UID16 select HAVE_UID16
select OLD_SIGSUSPEND3 select OLD_SIGSUSPEND3
@ -66,7 +66,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
- if (IS_ENABLED(CONFIG_X86_X32_ABI) && likely(xnr < X32_NR_syscalls)) { - 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)) { + if (IS_ENABLED(CONFIG_X86_X32_ABI) && unlikely(x32_enabled) && likely(xnr < X32_NR_syscalls)) {
xnr = array_index_nospec(xnr, X32_NR_syscalls); xnr = array_index_nospec(xnr, X32_NR_syscalls);
regs->ax = x32_sys_call(regs, xnr); regs->ax = x32_sys_call_table[xnr](regs);
return true; return true;
--- a/arch/x86/entry/syscall_x32.c --- a/arch/x86/entry/syscall_x32.c
+++ b/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 <linux/syscalls.h>
#include <asm/syscall.h> #include <asm/syscall.h>
@@ -20,3 +23,46 @@ long x32_sys_call(const struct pt_regs * @@ -16,3 +19,46 @@
default: return __x64_sys_ni_syscall(regs); asmlinkage const sys_call_ptr_t x32_sys_call_table[] = {
} #include <asm/syscalls_x32.h>
}; };
+ +
+/* Maybe enable x32 syscalls */ +/* Maybe enable x32 syscalls */
@ -129,7 +129,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+arch_param_cb(x32, &x32_param_ops, NULL, 0444); +arch_param_cb(x32, &x32_param_ops, NULL, 0444);
--- a/arch/x86/include/asm/elf.h --- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h
@@ -11,6 +11,9 @@ @@ -12,6 +12,9 @@
#include <asm/user.h> #include <asm/user.h>
#include <asm/auxvec.h> #include <asm/auxvec.h>
#include <asm/fsgsbase.h> #include <asm/fsgsbase.h>
@ -142,13 +142,13 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
@@ -150,7 +153,8 @@ do { \ @@ -150,7 +153,8 @@ do { \
#define compat_elf_check_arch(x) \ #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)) - (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
+ (IS_ENABLED(CONFIG_X86_X32_ABI) && x32_enabled && \ + (IS_ENABLED(CONFIG_X86_X32_ABI) && x32_enabled && \
+ (x)->e_machine == EM_X86_64)) + (x)->e_machine == EM_X86_64))
#if __USER32_DS != __USER_DS static inline void elf_common_init(struct thread_struct *t,
# error "The following code assumes __USER32_DS == __USER_DS" struct pt_regs *regs, const u16 ds)
--- a/arch/x86/include/asm/syscall.h --- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
@ -159,9 +159,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
#include <asm/thread_info.h> /* for TS_COMPAT */ #include <asm/thread_info.h> /* for TS_COMPAT */
#include <asm/unistd.h> #include <asm/unistd.h>
@@ -28,6 +29,18 @@ extern long ia32_sys_call(const struct p @@ -30,6 +31,18 @@ extern const sys_call_ptr_t ia32_sys_cal
extern long x32_sys_call(const struct pt_regs *, unsigned int nr); extern const sys_call_ptr_t x32_sys_call_table[];
extern long x64_sys_call(const struct pt_regs *, unsigned int nr); #endif
+#if defined(CONFIG_X86_X32_ABI) +#if defined(CONFIG_X86_X32_ABI)
+#if defined(CONFIG_X86_X32_DISABLED) +#if defined(CONFIG_X86_X32_DISABLED)