提交 430485ee 编写于 作者: Z Zhen Lei 提交者: Zheng Zengkai

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: NZhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: NJiahao Chen <chenjiahao16@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 4d18b148
......@@ -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
......
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册