提交 280ca8b0 编写于 作者: Y Yury Norov 提交者: Yang Yingliang

arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

hulk inclusion
category: feature
bugzilla: NA
CVE: NA
---------------------------

ILP32 has context-related structures different from both aarch32 and
aarch64/lp64. In this patch compat_arch_ptrace() renamed to
compat_a32_ptrace(), and compat_arch_ptrace() only makes choice between
compat_a32_ptrace() and new compat_ilp32_ptrace() handler.

compat_ilp32_ptrace() calls generic compat_ptrace_request() for all
requests except PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, which need
special handling.
Signed-off-by: NYury Norov <ynorov@caviumnetworks.com>
Signed-off-by: NBamvor Jian Zhang <bamv2005@gmail.com>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NHanjun Guo &lt;guohanjun@huawei.com <mailto:guohanjun@huawei.com&gt;>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e96549b3
...@@ -1059,9 +1059,11 @@ static const struct user_regset_view user_aarch64_view = { ...@@ -1059,9 +1059,11 @@ static const struct user_regset_view user_aarch64_view = {
.regsets = aarch64_regsets, .n = ARRAY_SIZE(aarch64_regsets) .regsets = aarch64_regsets, .n = ARRAY_SIZE(aarch64_regsets)
}; };
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_COMPAT
#include <linux/compat.h> #include <linux/compat.h>
#endif
#ifdef CONFIG_AARCH32_EL0
enum compat_regset { enum compat_regset {
REGSET_COMPAT_GPR, REGSET_COMPAT_GPR,
REGSET_COMPAT_VFP, REGSET_COMPAT_VFP,
...@@ -1527,7 +1529,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, ...@@ -1527,7 +1529,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num,
} }
#endif /* CONFIG_HAVE_HW_BREAKPOINT */ #endif /* CONFIG_HAVE_HW_BREAKPOINT */
long compat_arch_ptrace(struct task_struct *child, compat_long_t request, static long compat_a32_ptrace(struct task_struct *child, compat_long_t request,
compat_ulong_t caddr, compat_ulong_t cdata) compat_ulong_t caddr, compat_ulong_t cdata)
{ {
unsigned long addr = caddr; unsigned long addr = caddr;
...@@ -1604,8 +1606,23 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -1604,8 +1606,23 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
return ret; return ret;
} }
#else
#define compat_a32_ptrace(child, request, caddr, cdata) (0)
#endif /* CONFIG_AARCH32_EL0 */ #endif /* CONFIG_AARCH32_EL0 */
#ifdef CONFIG_COMPAT
long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
compat_ulong_t caddr, compat_ulong_t cdata)
{
if (is_a32_compat_task())
return compat_a32_ptrace(child, request, caddr, cdata);
/* ILP32 */
return compat_ptrace_request(child, request, caddr, cdata);
}
#endif
const struct user_regset_view *task_user_regset_view(struct task_struct *task) const struct user_regset_view *task_user_regset_view(struct task_struct *task)
{ {
#ifdef CONFIG_AARCH32_EL0 #ifdef CONFIG_AARCH32_EL0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册