Commit Graph

12 Commits

Author SHA1 Message Date
Rich Felker ac89e2ccf5 remove gratuitous aligned attribute from __ptrace_syscall_info
this change was discussed on the mailing list thread for the linux
uapi v5.3 patches, and submitted as a v2 patch, but overlooked when I
applied the patches much later.

revert commit f291c09ec9 and apply the
v2 as submitted; the net change is just padding.

notes by Szabolcs Nagy follow:

compared to the linux uapi (and glibc) a padding is used instead of
aligned attribute for keeping the layout the same across targets, this
means the alignment of the struct may be different on some targets
(e.g. m68k where uint64_t is 2 byte aligned) but that should not affect
syscalls and this way the abi does not depend on nonstandard extensions.
2020-01-01 11:16:56 -05:00
Szabolcs Nagy f291c09ec9 sys/ptrace.h: add PTRACE_GET_SYSCALL_INFO from linux v5.3
ptrace API to get details of the syscall the tracee is blocked in, see

  linux commit 201766a20e30f982ccfe36bebfad9602c3ff574a
  ptrace: add PTRACE_GET_SYSCALL_INFO request

the align attribute was used to keep the layout the same across targets
e.g. on m68k uint32_t is 2 byte aligned, this helps with compat ptrace.
2019-12-30 18:12:49 -05:00
Szabolcs Nagy df6d9450ea add support for arch-specific ptrace command macros
sys/ptrace.h is target specific, use bits/ptrace.h to add target
specific macro definitions.

these macros are kept in the generic sys/ptrace.h even though some
targets don't support them:

PTRACE_GETREGS
PTRACE_SETREGS
PTRACE_GETFPREGS
PTRACE_SETFPREGS
PTRACE_GETFPXREGS
PTRACE_SETFPXREGS

so no macro definition got removed in this patch on any target. only
s390x has a numerically conflicting macro definition (PTRACE_SINGLEBLOCK).

the PT_ aliases follow glibc headers, otherwise the definitions come
from linux uapi headers except ones that are skipped in glibc and
there is no real kernel support (s390x PTRACE_*_AREA) or need special
type definitions (mips PTRACE_*_WATCH_*) or only relevant for linux
2.4 compatibility (PTRACE_OLDSETOPTIONS).
2018-07-17 22:25:08 -04:00
Szabolcs Nagy 7ea32a8282 sys/ptrace.h: add missing PTRACE_EVENT_STOP
new in linux v3.1 commit 3544d72a0e10d0aa1c1bd59ed77a53a59cdc12f7
changed in linux v3.4 commit 5cdf389aee90109e2e3d88085dea4dd5508a3be7

A tracer recieves this event in the waitpid status of a PTRACED_SEIZED
process.
2018-07-17 22:24:15 -04:00
Szabolcs Nagy 0f7aa600f7 sys/ptrace.h: add PTRACE_SECCOMP_GET_METADATA from linux v4.16
to get seccomp state for checkpoint restore.
added in linux commit 26500475ac1b499d8636ff281311d633909f5d20

struct tag follows the glibc api and ptrace_peeksiginfo_args
got changed too accordingly.
2018-06-19 13:25:33 -04:00
Szabolcs Nagy c243d6f095 add new PTRACE_SECCOMP_GET_FILTER ptrace command
allows the tracer to dump the bpf seccomp filters of the tracee,
new in linux v4.4, commit f8e529ed941ba2bbcbf310b575d968159ce7e895
2016-01-26 18:31:17 -05:00
Szabolcs Nagy aaa604052d add new PTRACE_O_SUSPEND_SECCOMP ptrace option
allows a ptracer process to disable/enable seccomp filters of the
traced process, useful for checkpoint/restore, new in v4.3 commit
13c4a90119d28cfcb6b5bdd820c233b86c2b0237
2016-01-26 18:30:30 -05:00
Szabolcs Nagy 0a7ecf7606 ptrace.h: add new ptrace requests to get/set sigmask
PTRACE_GETSIGMASK and PTRACE_SETSIGMASK were added in linux v3.11
and used by checkpoint/restore tools
2013-09-15 02:49:26 +00:00
Szabolcs Nagy a512c7d849 add PTRACE_PEEKSIGINFO to ptrace.h
added in linux-v3.10 commit 84c751bd4aebbaae995fe32279d3dba48327bad4
using stdint.h types for the new ptrace_peeksiginfo_args struct
2013-07-24 22:17:24 +00:00
Szabolcs Nagy 2010361663 add missing ptrace requests and options to sys/ptrace.h 2013-01-12 19:42:39 +01:00
Rich Felker 71f7a3c2ce implement ptrace syscall wrapper (untested) 2011-09-15 13:03:13 -04:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00