提交 d3a61dd6 编写于 作者: X Xiongfeng Wang 提交者: Chen Jun

ilp32: avoid clearing upper 32 bits of syscall return value for ilp32

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: 15956689 ("arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return")
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
上级 28cc1f4e
无相关合并请求
......@@ -39,7 +39,7 @@ static inline long syscall_get_error(struct task_struct *task,
{
unsigned long error = regs->regs[0];
if (is_compat_thread(task_thread_info(task)))
if (is_a32_compat_thread(task_thread_info(task)))
error = sign_extend64(error, 31);
return IS_ERR_VALUE(error) ? error : 0;
......@@ -58,7 +58,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;
......
......@@ -50,7 +50,7 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno,
ret = do_ni_syscall(regs, scno);
}
if (is_compat_task())
if (is_a32_compat_task())
ret = lower_32_bits(ret);
regs->regs[0] = ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部