]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 302900,302902,302921,303461,304009:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 15 Aug 2016 21:10:41 +0000 (21:10 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 15 Aug 2016 21:10:41 +0000 (21:10 +0000)
commitea52eb8a1de290e2e0425b6dec5f6aa833d5e279
treefacb8a599daa20c5e3f1febf1cf90e71f5a09c35
parent2b7a8e8dbfb8291fbbbb83e279cabe7a80ffc4d5
MFC 302900,302902,302921,303461,304009:
Add a mask of optional ptrace() events.

302900:
Add a test for user signal delivery.

This test verifies we get the correct ptrace event details when a signal
is posted to a traced process from userland.

302902:
Add a mask of optional ptrace() events.

ptrace() now stores a mask of optional events in p_ptevents.  Currently
this mask is a single integer, but it can be expanded into an array of
integers in the future.

Two new ptrace requests can be used to manipulate the event mask:
PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK
sets the current event mask.

The current set of events include:
- PTRACE_EXEC: trace calls to execve().
- PTRACE_SCE: trace system call entries.
- PTRACE_SCX: trace syscam call exits.
- PTRACE_FORK: trace forks and auto-attach to new child processes.
- PTRACE_LWP: trace LWP events.

The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have
been replaced by PTRACE_SCE and PTRACE_SCX.  PTRACE_FORK replaces
P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS.

The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for
compatibility but now simply toggle corresponding flags in the
event mask.

While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both
modify the event mask and continue the traced process.

302921:
Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.

303461:
Note that not all optional ptrace events use SIGTRAP.

New child processes attached due to PTRACE_FORK use SIGSTOP instead of
SIGTRAP.  All other ptrace events use SIGTRAP.

304009:
Remove description of P_FOLLOWFORK as this flag was removed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@304188 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
13 files changed:
bin/ps/ps.1
lib/libc/sys/ptrace.2
sys/i386/linux/linux_ptrace.c
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_sig.c
sys/kern/kern_thr.c
sys/kern/subr_syscall.c
sys/kern/sys_process.c
sys/sys/proc.h
sys/sys/ptrace.h
tests/sys/kern/ptrace_test.c