Commit 430485ee authored by Zhen Lei's avatar Zhen Lei Committed by Zheng Zengkai
Browse files

Revert "arm64: fix current_thread_info()->addr_limit setup"

hulk inclusion
category: performance
bugzilla: https://e.gitee.com/open_euler/issues/list?issue=I4SCW7


CVE: NA

-------------------------------------------------------------------------

This reverts commit 979046bd.

The macro 'USER_DS' and related assembly code is deleted by
commit 3d2403fd ("arm64: uaccess: remove set_fs()", so the
problem fixed by this patch is disappeared accordingly.

Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: default avatarJiahao Chen <chenjiahao16@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4d18b148
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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
+1 −2
Original line number Diff line number Diff line
@@ -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 */
+0 −7
Original line number Diff line number Diff line
@@ -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);