ptrace.2: Describe the PTRACE_GET_SYSCALL_INFO 'op' value in more detail

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2019-09-12 10:30:57 +02:00
parent 93c37f08be
commit f04534d22c
1 changed files with 41 additions and 17 deletions

View File

@ -1034,33 +1034,26 @@ structure contains the following fields:
.in +4n
.EX
struct ptrace_syscall_info {
__u8 op; /* PTRACE_SYSCALL_INFO_* value
describing the kind
of system call stop,
see <linux/ptrace.h> */
__u32 arch; /* AUDIT_ARCH_* value,
see seccomp(2) */
__u64 instruction_pointer; /* CPU instruction pointer */
__u8 op; /* Type of system call stop */
__u32 arch; /* AUDIT_ARCH_* value; see seccomp(2) */
__u64 instruction_pointer; /* CPU instruction pointer */
__u64 stack_pointer; /* CPU stack pointer */
union {
struct {
struct { /* op == PTRACE_SYSCALL_INFO_ENTRY */
__u64 nr; /* System call number */
__u64 args[6]; /* System call arguments */
} entry; /* Information specific to
system call entry stops */
struct {
} entry;
struct { /* op == PTRACE_SYSCALL_INFO_EXIT */
__s64 rval; /* System call return value */
__u8 is_error; /* System call error flag */
} exit; /* Information specific to
system call exit stops */
struct {
} exit;
struct { /* op == PTRACE_SYSCALL_INFO_SECCOMP */
__u64 nr; /* System call number */
__u64 args[6]; /* System call arguments */
__u32 ret_data; /* The SECCOMP_RET_DATA portion
__u32 ret_data; /* SECCOMP_RET_DATA portion
of SECCOMP_RET_TRACE return
value */
} seccomp; /* Information specific to
PTRACE_EVENT_SECCOMP stops */
} seccomp;
};
};
.EE
@ -1077,6 +1070,37 @@ The rest of the structure is a union; one should read only those fields
that are meaningful for the kind of system call stop specified by the
.IR op
field.
.IP
The
.I op
field has one of the following values (defined in
.IR <linux/ptrace.h>)
indicating what type of stop occurred and
which part of the union is filled:
.RS
.TP
.BR PTRACE_SYSCALL_INFO_ENTRY
The
.I entry
component of the union contains information relating to a
system call entry stop.
.TP
.BR PTRACE_SYSCALL_INFO_EXIT
The
.I exit
component of the union contains information relating to a
system call exit stop.
.TP
.BR PTRACE_SYSCALL_INFO_SECCOMP
The
.I exit
component of the union contains information relating to a
.B PTRACE_EVENT_SECCOMP
stop.
.TP
.BR PTRACE_SYSCALL_INFO_NONE
No component of the union contains relevant information.
.RE
.\"
.SS Death under ptrace
When a (possibly multithreaded) process receives a killing signal