[lkml]   [2012]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip:x86/urgent] x86, x32, ptrace: Remove PTRACE_ARCH_PRCTL for x32
Commit-ID:  bad1a753d4d4deb09d4bc0bac1dd4fc3298502e9
Author: H.J. Lu <>
AuthorDate: Mon, 21 May 2012 20:29:45 -0700
Committer: H. Peter Anvin <>
CommitDate: Fri, 1 Jun 2012 13:54:21 -0700

x86, x32, ptrace: Remove PTRACE_ARCH_PRCTL for x32

When I added x32 ptrace to 3.4 kernel, I also include PTRACE_ARCH_PRCTL
support for x32 GDB For ARCH_GET_FS/GS, it takes a pointer to int64. But
at user level, ARCH_GET_FS/GS takes a pointer to int32. So I have to add
x32 ptrace to glibc to handle it with a temporary int64 passed to kernel and
copy it back to GDB as int32. Roland suggested that PTRACE_ARCH_PRCTL
is obsolete and x32 GDB should use fs_base and gs_base fields of
user_regs_struct instead.

Accordingly, remove PTRACE_ARCH_PRCTL completely from the x32 code to
avoid possible memory overrun when pointer to int32 is passed to

Signed-off-by: H. Peter Anvin <>
Cc: <> v3.4
arch/x86/kernel/ptrace.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 13b1990..c4c6a5c 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -1211,12 +1211,6 @@ static long x32_arch_ptrace(struct task_struct *child,
0, sizeof(struct user_i387_struct),

- /* normal 64bit interface to access TLS data.
- Works just like arch_prctl, except that the arguments
- are reversed. */
- return do_arch_prctl(child, data, addr);
return compat_ptrace_request(child, request, addr, data);

 \ /
  Last update: 2012-06-02 21:41    [W:0.076 / U:0.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site