From: Xiongfeng Wang wangxiongfeng2@huawei.com
Offering: HULK hulk inclusion category: bugfix bugzilla: 46790 DTS: NA
--------------------------------
The following commit clear upper 32 bits of x0 on syscall return for compat application. But it is only suitable for A32 applications. It is not correct for ilp32 applications.
Fixes: 15956689a0e60 ("arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return") Signed-off-by: Xiongfeng Wang wangxiongfeng2@huawei.com Acked-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com
Conflicts: arch/arm64/include/asm/syscall.h arch/arm64/kernel/syscall.c
Signed-off-by: Chen Jiahao chenjiahao16@huawei.com --- arch/arm64/include/asm/syscall.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h index eafd1302b237..c2dceebdc9a2 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -38,7 +38,7 @@ static inline long syscall_get_return_value(struct task_struct *task, { unsigned long val = regs->regs[0];
- if (is_compat_thread(task_thread_info(task))) + if (is_a32_compat_thread(task_thread_info(task))) val = sign_extend64(val, 31);
return val; @@ -59,7 +59,7 @@ static inline void syscall_set_return_value(struct task_struct *task, if (error) val = error;
- if (is_compat_thread(task_thread_info(task))) + if (is_a32_compat_thread(task_thread_info(task))) val = lower_32_bits(val);
regs->regs[0] = val;