Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   kamil
Date:           Mon Sep 30 21:13:33 UTC 2019

Modified Files:
        src/sys/compat/sys: siginfo.h
        src/sys/kern: kern_exec.c kern_fork.c kern_lwp.c kern_proc.c kern_sig.c
            sys_lwp.c sys_ptrace_common.c
        src/sys/sys: proc.h siginfo.h signalvar.h

Log Message:
Move TRAP_CHLD/TRAP_LWP ptrace information from struct proc to siginfo

Storing struct ptrace_state information inside struct proc was vulnerable
to synchronization bugs, as multiple events emitted in the same time were
overwritting other ones.

Cache the original parent process id in p_oppid. Reusing here p_opptr is
in theory prone to slight race codition.

Change the semantics of PT_GET_PROCESS_STATE, reutning EINVAL for calls
prompting for the value in cases when there wasn't registered an
appropriate event.

Add an alternative approach to check the ptrace_state information, directly
from the siginfo_t value returned from PT_GET_SIGINFO. The original
PT_GET_PROCESS_STATE approach is kept for compat with older NetBSD and
OpenBSD. New code is recommended to keep using PT_GET_PROCESS_STATE.

Add a couple of compile-time asserts for assumptions in the code.

No functional change intended in existing ptrace(2) software.

All ATF ptrace(2) and ATF GDB tests pass.

This change improves reliability of the threading ptrace(2) code.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/sys/siginfo.h
cvs rdiff -u -r1.481 -r1.482 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.213 -r1.214 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.202 -r1.203 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.364 -r1.365 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/sys_lwp.c
cvs rdiff -u -r1.58 -r1.59 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.355 -r1.356 src/sys/sys/proc.h
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/siginfo.h
cvs rdiff -u -r1.95 -r1.96 src/sys/sys/signalvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index