Skip to content

Commit bad1a75

Browse files
hjl-toolsH. Peter Anvin
authored andcommitted
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 kernel. Link: http://lkml.kernel.org/r/CAMe9rOpDzHfS7NH7m1vmD9QRw8SSj4Sc%2BaNOgcWm_WJME2eRsQ@mail.gmail.com Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: <stable@vger.kernel.org> v3.4
1 parent 0c75966 commit bad1a75

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

arch/x86/kernel/ptrace.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,12 +1211,6 @@ static long x32_arch_ptrace(struct task_struct *child,
12111211
0, sizeof(struct user_i387_struct),
12121212
datap);
12131213

1214-
/* normal 64bit interface to access TLS data.
1215-
Works just like arch_prctl, except that the arguments
1216-
are reversed. */
1217-
case PTRACE_ARCH_PRCTL:
1218-
return do_arch_prctl(child, data, addr);
1219-
12201214
default:
12211215
return compat_ptrace_request(child, request, addr, data);
12221216
}

0 commit comments

Comments
 (0)