Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1304025

[PATCH v6 13/21] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32

From Yury Norov <ynorov@caviumnetworks.com>
Newsgroups linux.kernel
Subject [PATCH v6 13/21] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32
Date 2016-01-08 00:50 +0100
Message-ID <qOstB-6LL-35@gated-at.bofh.it> (permalink)
References <qOsjT-6Hv-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/arm64/kernel/ptrace.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index c166548..f95fb89 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -1108,7 +1108,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num,
 }
 #endif	/* CONFIG_HAVE_HW_BREAKPOINT */
 
-long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
+long compat_a32_ptrace(struct task_struct *child, compat_long_t request,
 			compat_ulong_t caddr, compat_ulong_t cdata)
 {
 	unsigned long addr = caddr;
@@ -1185,8 +1185,25 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 
 	return ret;
 }
+#else
+
+#define compat_a32_ptrace(child, request, caddr, cdata) (-1)
+
 #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);
+
+	return compat_ptrace_request(child, request, caddr, cdata);
+}
+
+#endif /* CONFIG_COMPAT */
+
 const struct user_regset_view *task_user_regset_view(struct task_struct *task)
 {
 #ifdef CONFIG_AARCH32_EL0
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC4 PATCH v6 00/21] ILP32 for ARM64 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:40 +0100
  [PATCH v6 12/21] arm64:ilp32: share HWCAP between LP64 and ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:40 +0100
    Re: [PATCH v6 12/21] arm64:ilp32: share HWCAP between LP64 and ILP32 Arnd Bergmann <arnd@arndb.de> - 2016-01-08 10:00 +0100
  [PATCH v6 05/21] arm64: compat: fix wrong dependency Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:40 +0100
    Re: [PATCH v6 05/21] arm64: compat: fix wrong dependency Arnd Bergmann <arnd@arndb.de> - 2016-01-08 10:00 +0100
  [PATCH v6 03/21] arm64: rename COMPAT to AARCH32_EL0 in Kconfig Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:40 +0100
  [PATCH v6 21/21] arm64:ilp32: add ARM64_ILP32 to Kconfig Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
  [PATCH v6 15/21] arm64: signal: wrap struct ucontext, fp and lr with struct sigframe Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
  [PATCH v6 18/21] arm64: ilp32: introduce ilp32-specific handlers for sigframe Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
  [PATCH v6 20/21] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
    Re: [PATCH v6 20/21] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Arnd Bergmann <arnd@arndb.de> - 2016-01-08 10:10 +0100
  [PATCH v6 13/21] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
    Re: [PATCH v6 13/21] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 Arnd Bergmann <arnd@arndb.de> - 2016-01-08 10:10 +0100
  [PATCH v6 19/21] arm64:ilp32: add vdso-ilp32 and use for signal return Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
  [PATCH v6 16/21] arm64: signal: share lp64 signal routines to ilp32 Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
  [PATCH v6 14/21] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100
    Re: [PATCH v6 14/21] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2016-01-08 10:10 +0100
    Re: [PATCH v6 14/21] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2016-01-08 10:30 +0100
      Re: [PATCH v6 14/21] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 12:20 +0100
        Re: [PATCH v6 14/21] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Arnd Bergmann <arnd@arndb.de> - 2016-01-08 17:50 +0100
      Re: [PATCH v6 14/21] arm64:ilp32: add sys_ilp32.c and a separate  table (in entry.S) to use it Yury Norov <ynorov@caviumnetworks.com> - 2016-01-13 17:30 +0100
  [PATCH v6 17/21] arm64: signal32: move ilp32 and aarch32 common code to separated file Yury Norov <ynorov@caviumnetworks.com> - 2016-01-08 00:50 +0100

csiph-web