diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index af8d540430caab9f08c8a8cbdea1cfb9ce667795..35a4f26f014442463cda566d3f28e5ebe7d03235 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -9,8 +9,7 @@ #define __ASM_PROCESSOR_H #define KERNEL_DS UL(-1) -#define USER_DS (is_compat_task() ? \ - (UL(0x100000000) - 1) : (TASK_SIZE - 1)) +#define USER_DS ((UL(1) << VA_BITS) - 1) /* * On arm64 systems, unaligned accesses by the CPU are cheap, and so there is diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 91dc57c9a17c7784cbfced6a6c494e3e642dfc64..e1c604d21a41c7891b4e0daa740315caf38fa141 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -221,8 +221,7 @@ alternative_else_nop_endif /* Save the task's original addr_limit and set USER_DS */ ldr x20, [tsk, #TSK_TI_ADDR_LIMIT] str x20, [sp, #S_ORIG_ADDR_LIMIT] - /* expand USER_DS here using its value while is_compat_task() is false */ - mov x20, #((UL(1) << VA_BITS) - 1) + mov x20, #USER_DS str x20, [tsk, #TSK_TI_ADDR_LIMIT] /* No need to reset PSTATE.UAO, hardware's already set it to 0 for us */ .endif /* \el == 0 */ diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index a55d518ee868540162d32efbc44bcc8c261e3f28..47d5ee8120c378a7b737baa50029f56cb051f2fc 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -628,13 +628,6 @@ unsigned long arch_align_stack(unsigned long sp) */ void arch_setup_new_exec(void) { - /* - * set the address limit for the new executable. - * Here we reset the addr_limit only for the scenario - * where is_compat_task() is set in AARCH64 kernel. - */ - set_fs(USER_DS); - current->mm->context.flags = is_compat_task() ? MMCF_AARCH32 : 0; ptrauth_thread_init_user(current);