This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/22433] linux x86/x86_64 <sys/ptrace.h> does not provide PTRACE_GET_THREAD_AREA (and more)
- From: "mbalao at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 16 Dec 2017 18:51:34 +0000
- Subject: [Bug libc/22433] linux x86/x86_64 <sys/ptrace.h> does not provide PTRACE_GET_THREAD_AREA (and more)
- Auto-submitted: auto-generated
- References: <bug-22433-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=22433
Martin Balao <mbalao at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mbalao at redhat dot com
--- Comment #2 from Martin Balao <mbalao at redhat dot com> ---
Kernel side (verified on kernel f6f3732 - 2017-12-15 18:53:22 -0800):
.................................
PTRACE_GET_THREAD_AREA is defined for the following architectures:
* arc - value 25
* arm - value 22
* arm64 - value 22
* m68k - value 25
* mips - value 25
* unicore32 - value 22
* x86 - value 25
* x86_64 - value 25
PTRACE_SET_THREAD_AREA is defined for the following architectures:
* mips - value 26
* x86 - value 26
* x86_64 - value 26
PTRACE_ARCH_PRCTL is defined for the following architectures:
* x86_64 - value 30
PTRACE_SYSEMU is defined for the following architectures:
* x86 - value 31
* x86_64 - value 31
PTRACE_SYSEMU_SINGLESTEP is defined for the following architectures:
* x86 - value 32
* x86_64 - value 32
glibc side (verified on 2767ebd - 2017-11-18 19:27:03 +0100)
.................................
PTRACE_GET_THREAD_AREA is defined in aarch64/sys/ptrace.h with value 22.
Conclusion
.................................
PTRACE_GET_THREAD_AREA, PTRACE_SET_THREAD_AREA, PTRACE_ARCH_PRCTL, etc. values
are arch specific and not defined for most architectures on the kernel side.
This make me think that a ptrace.h split for x86/x86_64 will be necessary on
the glibc side -as it has been already done for aarch64-.
Are you okay with this?
BTW, if we aim to execute a ptrace -
PTRACE_GET_THREAD_AREA/PTRACE_SET_THREAD_AREA call using glibc headers only, it
worths noting that "struct user_desc" is not defined -there is an internal
definition at sysdeps/i386/nptl/tls.h used by
sysdeps/unix/sysv/linux/i386/clone.S only-. The only current alternative is to
use the kernel definition found in asm/ldt.h.
--
You are receiving this mail because:
You are on the CC list for the bug.